How do I add a second action (segue) to a UIAlertAction action?How to change the name of an iOS app?How can I make a UITextField move up when the keyboard is present - on starting to edit?What are Unwind segues for and how do you use them?How would I create a UIAlertView in Swift?Writing handler for UIAlertActionAdd Image to UIAlertAction in UIAlertControllerUIAlertAction handler is not calledThis action could not be completed. Try Again (-22421)Perform segue with UIAlertActionSwift: How to make an action occur if UIAlertAction is pressed?
Is a switch from R to Python worth it?
Ubuntu show wrong disk sizes, how to solve it?
If someone else uploads my GPL'd code to Github without my permission, is that a copyright violation?
How does LIDAR avoid getting confused in an environment being scanned by hundreds of other LIDAR?
Pronouns when writing from the point of view of a robot
Is space radiation a risk for space film photography, and how is this prevented?
What could prevent players from leaving an island?
Whats the difference between <processors> and <pipelines> in Sitecore configuration?
Can you take actions after being healed at 0hp?
What was the role of Commodore-West Germany?
Does the length of a password for Wi-Fi affect speed?
Does a 4 bladed prop have almost twice the thrust of a 2 bladed prop?
How easy is it to get a gun illegally in the United States?
How to call made-up data?
If the interviewer says "We have other interviews to conduct and then back to you in few days", is it a bad sign to not get the job?
In MTG, was there ever a five-color deck that worked well?
A verb for when some rights are not violated?
New workplace asking for bank pin and account number
Did Captain America make out with his niece?
How can I perform a deterministic physics simulation?
How to switch an 80286 from protected to real mode?
Premier League simulation
If a vampire drinks blood of a sick human, does the vampire get infected?
Why is the Vasa Museum in Stockholm so Popular?
How do I add a second action (segue) to a UIAlertAction action?
How to change the name of an iOS app?How can I make a UITextField move up when the keyboard is present - on starting to edit?What are Unwind segues for and how do you use them?How would I create a UIAlertView in Swift?Writing handler for UIAlertActionAdd Image to UIAlertAction in UIAlertControllerUIAlertAction handler is not calledThis action could not be completed. Try Again (-22421)Perform segue with UIAlertActionSwift: How to make an action occur if UIAlertAction is pressed?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Please excuse me, i'm relatively new to ios coding:
I have implemented an actionSheet with "Cancel" and "Buy" buttons. The Buy button action executes successfully, no problem.
But, what I want to do, is add another (2nd) action that lets user automatically segue to another screen after the original (1st) action is called.
Simplified: I want to press the Buy button (on my actionSheet) which downloads product, and then want to be automatically taken to the download screen to see my new downloads.
private func setBuyButton() -> Void
// Buy button action sheet
actionSheet = UIAlertController(title: "CONFIRM PURCHASE", message: "(self.products.title) will be added to your Download page", preferredStyle: .actionSheet)
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let confirmPurchase = UIAlertAction(title: "Buy", style: .default) action in
var productList = [String: Bool]()
let productSetName = [self.productSetId : true]
self.product.map( (drop: Drop) -> Void in
productList[product.productKey] = true
)
if let userId = KeychainWrapper.standard.string(forKey: KEY_UID)
let downloads = ["product": productList, "productset": productSetName]
DataService......blah, blah, blah...
actionSheet.addAction(confirmPurchase)
actionSheet.addAction(cancel)
ios swift uialertcontroller uialertaction
add a comment |
Please excuse me, i'm relatively new to ios coding:
I have implemented an actionSheet with "Cancel" and "Buy" buttons. The Buy button action executes successfully, no problem.
But, what I want to do, is add another (2nd) action that lets user automatically segue to another screen after the original (1st) action is called.
Simplified: I want to press the Buy button (on my actionSheet) which downloads product, and then want to be automatically taken to the download screen to see my new downloads.
private func setBuyButton() -> Void
// Buy button action sheet
actionSheet = UIAlertController(title: "CONFIRM PURCHASE", message: "(self.products.title) will be added to your Download page", preferredStyle: .actionSheet)
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let confirmPurchase = UIAlertAction(title: "Buy", style: .default) action in
var productList = [String: Bool]()
let productSetName = [self.productSetId : true]
self.product.map( (drop: Drop) -> Void in
productList[product.productKey] = true
)
if let userId = KeychainWrapper.standard.string(forKey: KEY_UID)
let downloads = ["product": productList, "productset": productSetName]
DataService......blah, blah, blah...
actionSheet.addAction(confirmPurchase)
actionSheet.addAction(cancel)
ios swift uialertcontroller uialertaction
Just insert the line for the segue after the download process complete or may in completion handler if any.
– Krunal Nagvadia
Mar 27 at 3:53
add a comment |
Please excuse me, i'm relatively new to ios coding:
I have implemented an actionSheet with "Cancel" and "Buy" buttons. The Buy button action executes successfully, no problem.
But, what I want to do, is add another (2nd) action that lets user automatically segue to another screen after the original (1st) action is called.
Simplified: I want to press the Buy button (on my actionSheet) which downloads product, and then want to be automatically taken to the download screen to see my new downloads.
private func setBuyButton() -> Void
// Buy button action sheet
actionSheet = UIAlertController(title: "CONFIRM PURCHASE", message: "(self.products.title) will be added to your Download page", preferredStyle: .actionSheet)
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let confirmPurchase = UIAlertAction(title: "Buy", style: .default) action in
var productList = [String: Bool]()
let productSetName = [self.productSetId : true]
self.product.map( (drop: Drop) -> Void in
productList[product.productKey] = true
)
if let userId = KeychainWrapper.standard.string(forKey: KEY_UID)
let downloads = ["product": productList, "productset": productSetName]
DataService......blah, blah, blah...
actionSheet.addAction(confirmPurchase)
actionSheet.addAction(cancel)
ios swift uialertcontroller uialertaction
Please excuse me, i'm relatively new to ios coding:
I have implemented an actionSheet with "Cancel" and "Buy" buttons. The Buy button action executes successfully, no problem.
But, what I want to do, is add another (2nd) action that lets user automatically segue to another screen after the original (1st) action is called.
Simplified: I want to press the Buy button (on my actionSheet) which downloads product, and then want to be automatically taken to the download screen to see my new downloads.
private func setBuyButton() -> Void
// Buy button action sheet
actionSheet = UIAlertController(title: "CONFIRM PURCHASE", message: "(self.products.title) will be added to your Download page", preferredStyle: .actionSheet)
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let confirmPurchase = UIAlertAction(title: "Buy", style: .default) action in
var productList = [String: Bool]()
let productSetName = [self.productSetId : true]
self.product.map( (drop: Drop) -> Void in
productList[product.productKey] = true
)
if let userId = KeychainWrapper.standard.string(forKey: KEY_UID)
let downloads = ["product": productList, "productset": productSetName]
DataService......blah, blah, blah...
actionSheet.addAction(confirmPurchase)
actionSheet.addAction(cancel)
ios swift uialertcontroller uialertaction
ios swift uialertcontroller uialertaction
edited Mar 27 at 5:00
Arasuvel
2,6311 gold badge20 silver badges31 bronze badges
2,6311 gold badge20 silver badges31 bronze badges
asked Mar 27 at 3:48
JamakesJamakes
64 bronze badges
64 bronze badges
Just insert the line for the segue after the download process complete or may in completion handler if any.
– Krunal Nagvadia
Mar 27 at 3:53
add a comment |
Just insert the line for the segue after the download process complete or may in completion handler if any.
– Krunal Nagvadia
Mar 27 at 3:53
Just insert the line for the segue after the download process complete or may in completion handler if any.
– Krunal Nagvadia
Mar 27 at 3:53
Just insert the line for the segue after the download process complete or may in completion handler if any.
– Krunal Nagvadia
Mar 27 at 3:53
add a comment |
2 Answers
2
active
oldest
votes
With a programmatically.
Create a file DownloadView
with the subclass of UICollectionViewController
, then in your action add these code
let layout = UICollectionViewFlowLayout()
let controller = DownloadView.init(collectionViewLayout: layout)
self.navigationController?.pushViewController(controller, animated: true)
Also, if you don't need a collectionView
, create a file with subclass of UIViewController
and push it like this
self.navigationController?.pushViewController(DownloadView(), animated: true)
With Storyboard
Add viewController with identifer down
and write these code in action handler
let downloadView = self.storyboard?.instantiateViewController(withIdentifier: "down") as! DownloadView
self.present(downloadView, animated:true, completion:nil)
Thanks Picker ! I used the 3rd option (with Storyboard), Working nicely!
– Jamakes
Mar 27 at 22:55
Yourwellcom, please check the correct answer to find easy by others
– Picker
Mar 28 at 13:10
Hi Picker, I just noticed that while the code is working and shows the correct screen, It is not changing and hi-lighting the UITabBar Icon / item of the screen i've segued to, How do i change the selected TabBar icon? The Code: let myProductsView = self.storyboard?.instantiateViewController(withIdentifier: "MyProductsVC") as! MyProductsVC self.navigationController?.pushViewController(myProductsView, animated: false)
– Jamakes
Mar 29 at 2:45
The rootViewController should have a navigation controller, storyboard click the first screen-->edit-->embedin-->navigationController
– Picker
Mar 29 at 7:44
add a comment |
In your storyboard, control click the yellow circle icon above the view controller and drag to the destination view controller to create a segue.
Select the segue and give it an identifier
Now you can call performSegue(withIdentifier:sender:)
in your first view controller to segue programatically. In your case, put
self.performSegue(withIdentifier: "yourCustomSegue", sender: nil)
in your row action handler will do the trick.
Thanks, I'm very grateful Ricky, but I know how to create segues with IDs, I just wasn't sure where to put the code and if i needed some declaration. I have since figured that out with the help of @KrunalNagvadia 's answer. Thanks guys! Here's a follow-on question: Do i need to create a new segue, if the screen i'm going to is part of the UITabBarController? Can I just do the segue somehow through the UITabBarController? again pls note, i'm not advanced in coding, so my questions may be a bit low level.
– Jamakes
Mar 27 at 5:01
You can segue to theUITabBarController
, pass the information about which tab you want to select viaprepare(for:sender:)
, then select the right tab inviewDidLoad
of theUITabBarController
by changingselectedIndex
.
– Ricky Mo
Mar 27 at 5:07
Ok thanks Ricky, I'll try figure that out later today.
– Jamakes
Mar 27 at 5:41
Hey @Ricky, I'm forced to up-skill myself in Swift and I'm looking for a tutor for about two hour per week, Is this something you do or would consider? Thanks
– Jamakes
Mar 29 at 2:58
@Jamakes Nope, I'm not a tutor :-)
– Ricky Mo
Mar 29 at 3:05
|
show 1 more comment
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55369502%2fhow-do-i-add-a-second-action-segue-to-a-uialertaction-action%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
With a programmatically.
Create a file DownloadView
with the subclass of UICollectionViewController
, then in your action add these code
let layout = UICollectionViewFlowLayout()
let controller = DownloadView.init(collectionViewLayout: layout)
self.navigationController?.pushViewController(controller, animated: true)
Also, if you don't need a collectionView
, create a file with subclass of UIViewController
and push it like this
self.navigationController?.pushViewController(DownloadView(), animated: true)
With Storyboard
Add viewController with identifer down
and write these code in action handler
let downloadView = self.storyboard?.instantiateViewController(withIdentifier: "down") as! DownloadView
self.present(downloadView, animated:true, completion:nil)
Thanks Picker ! I used the 3rd option (with Storyboard), Working nicely!
– Jamakes
Mar 27 at 22:55
Yourwellcom, please check the correct answer to find easy by others
– Picker
Mar 28 at 13:10
Hi Picker, I just noticed that while the code is working and shows the correct screen, It is not changing and hi-lighting the UITabBar Icon / item of the screen i've segued to, How do i change the selected TabBar icon? The Code: let myProductsView = self.storyboard?.instantiateViewController(withIdentifier: "MyProductsVC") as! MyProductsVC self.navigationController?.pushViewController(myProductsView, animated: false)
– Jamakes
Mar 29 at 2:45
The rootViewController should have a navigation controller, storyboard click the first screen-->edit-->embedin-->navigationController
– Picker
Mar 29 at 7:44
add a comment |
With a programmatically.
Create a file DownloadView
with the subclass of UICollectionViewController
, then in your action add these code
let layout = UICollectionViewFlowLayout()
let controller = DownloadView.init(collectionViewLayout: layout)
self.navigationController?.pushViewController(controller, animated: true)
Also, if you don't need a collectionView
, create a file with subclass of UIViewController
and push it like this
self.navigationController?.pushViewController(DownloadView(), animated: true)
With Storyboard
Add viewController with identifer down
and write these code in action handler
let downloadView = self.storyboard?.instantiateViewController(withIdentifier: "down") as! DownloadView
self.present(downloadView, animated:true, completion:nil)
Thanks Picker ! I used the 3rd option (with Storyboard), Working nicely!
– Jamakes
Mar 27 at 22:55
Yourwellcom, please check the correct answer to find easy by others
– Picker
Mar 28 at 13:10
Hi Picker, I just noticed that while the code is working and shows the correct screen, It is not changing and hi-lighting the UITabBar Icon / item of the screen i've segued to, How do i change the selected TabBar icon? The Code: let myProductsView = self.storyboard?.instantiateViewController(withIdentifier: "MyProductsVC") as! MyProductsVC self.navigationController?.pushViewController(myProductsView, animated: false)
– Jamakes
Mar 29 at 2:45
The rootViewController should have a navigation controller, storyboard click the first screen-->edit-->embedin-->navigationController
– Picker
Mar 29 at 7:44
add a comment |
With a programmatically.
Create a file DownloadView
with the subclass of UICollectionViewController
, then in your action add these code
let layout = UICollectionViewFlowLayout()
let controller = DownloadView.init(collectionViewLayout: layout)
self.navigationController?.pushViewController(controller, animated: true)
Also, if you don't need a collectionView
, create a file with subclass of UIViewController
and push it like this
self.navigationController?.pushViewController(DownloadView(), animated: true)
With Storyboard
Add viewController with identifer down
and write these code in action handler
let downloadView = self.storyboard?.instantiateViewController(withIdentifier: "down") as! DownloadView
self.present(downloadView, animated:true, completion:nil)
With a programmatically.
Create a file DownloadView
with the subclass of UICollectionViewController
, then in your action add these code
let layout = UICollectionViewFlowLayout()
let controller = DownloadView.init(collectionViewLayout: layout)
self.navigationController?.pushViewController(controller, animated: true)
Also, if you don't need a collectionView
, create a file with subclass of UIViewController
and push it like this
self.navigationController?.pushViewController(DownloadView(), animated: true)
With Storyboard
Add viewController with identifer down
and write these code in action handler
let downloadView = self.storyboard?.instantiateViewController(withIdentifier: "down") as! DownloadView
self.present(downloadView, animated:true, completion:nil)
edited Mar 27 at 9:34
answered Mar 27 at 8:51
PickerPicker
281 silver badge4 bronze badges
281 silver badge4 bronze badges
Thanks Picker ! I used the 3rd option (with Storyboard), Working nicely!
– Jamakes
Mar 27 at 22:55
Yourwellcom, please check the correct answer to find easy by others
– Picker
Mar 28 at 13:10
Hi Picker, I just noticed that while the code is working and shows the correct screen, It is not changing and hi-lighting the UITabBar Icon / item of the screen i've segued to, How do i change the selected TabBar icon? The Code: let myProductsView = self.storyboard?.instantiateViewController(withIdentifier: "MyProductsVC") as! MyProductsVC self.navigationController?.pushViewController(myProductsView, animated: false)
– Jamakes
Mar 29 at 2:45
The rootViewController should have a navigation controller, storyboard click the first screen-->edit-->embedin-->navigationController
– Picker
Mar 29 at 7:44
add a comment |
Thanks Picker ! I used the 3rd option (with Storyboard), Working nicely!
– Jamakes
Mar 27 at 22:55
Yourwellcom, please check the correct answer to find easy by others
– Picker
Mar 28 at 13:10
Hi Picker, I just noticed that while the code is working and shows the correct screen, It is not changing and hi-lighting the UITabBar Icon / item of the screen i've segued to, How do i change the selected TabBar icon? The Code: let myProductsView = self.storyboard?.instantiateViewController(withIdentifier: "MyProductsVC") as! MyProductsVC self.navigationController?.pushViewController(myProductsView, animated: false)
– Jamakes
Mar 29 at 2:45
The rootViewController should have a navigation controller, storyboard click the first screen-->edit-->embedin-->navigationController
– Picker
Mar 29 at 7:44
Thanks Picker ! I used the 3rd option (with Storyboard), Working nicely!
– Jamakes
Mar 27 at 22:55
Thanks Picker ! I used the 3rd option (with Storyboard), Working nicely!
– Jamakes
Mar 27 at 22:55
Yourwellcom, please check the correct answer to find easy by others
– Picker
Mar 28 at 13:10
Yourwellcom, please check the correct answer to find easy by others
– Picker
Mar 28 at 13:10
Hi Picker, I just noticed that while the code is working and shows the correct screen, It is not changing and hi-lighting the UITabBar Icon / item of the screen i've segued to, How do i change the selected TabBar icon? The Code: let myProductsView = self.storyboard?.instantiateViewController(withIdentifier: "MyProductsVC") as! MyProductsVC self.navigationController?.pushViewController(myProductsView, animated: false)
– Jamakes
Mar 29 at 2:45
Hi Picker, I just noticed that while the code is working and shows the correct screen, It is not changing and hi-lighting the UITabBar Icon / item of the screen i've segued to, How do i change the selected TabBar icon? The Code: let myProductsView = self.storyboard?.instantiateViewController(withIdentifier: "MyProductsVC") as! MyProductsVC self.navigationController?.pushViewController(myProductsView, animated: false)
– Jamakes
Mar 29 at 2:45
The rootViewController should have a navigation controller, storyboard click the first screen-->edit-->embedin-->navigationController
– Picker
Mar 29 at 7:44
The rootViewController should have a navigation controller, storyboard click the first screen-->edit-->embedin-->navigationController
– Picker
Mar 29 at 7:44
add a comment |
In your storyboard, control click the yellow circle icon above the view controller and drag to the destination view controller to create a segue.
Select the segue and give it an identifier
Now you can call performSegue(withIdentifier:sender:)
in your first view controller to segue programatically. In your case, put
self.performSegue(withIdentifier: "yourCustomSegue", sender: nil)
in your row action handler will do the trick.
Thanks, I'm very grateful Ricky, but I know how to create segues with IDs, I just wasn't sure where to put the code and if i needed some declaration. I have since figured that out with the help of @KrunalNagvadia 's answer. Thanks guys! Here's a follow-on question: Do i need to create a new segue, if the screen i'm going to is part of the UITabBarController? Can I just do the segue somehow through the UITabBarController? again pls note, i'm not advanced in coding, so my questions may be a bit low level.
– Jamakes
Mar 27 at 5:01
You can segue to theUITabBarController
, pass the information about which tab you want to select viaprepare(for:sender:)
, then select the right tab inviewDidLoad
of theUITabBarController
by changingselectedIndex
.
– Ricky Mo
Mar 27 at 5:07
Ok thanks Ricky, I'll try figure that out later today.
– Jamakes
Mar 27 at 5:41
Hey @Ricky, I'm forced to up-skill myself in Swift and I'm looking for a tutor for about two hour per week, Is this something you do or would consider? Thanks
– Jamakes
Mar 29 at 2:58
@Jamakes Nope, I'm not a tutor :-)
– Ricky Mo
Mar 29 at 3:05
|
show 1 more comment
In your storyboard, control click the yellow circle icon above the view controller and drag to the destination view controller to create a segue.
Select the segue and give it an identifier
Now you can call performSegue(withIdentifier:sender:)
in your first view controller to segue programatically. In your case, put
self.performSegue(withIdentifier: "yourCustomSegue", sender: nil)
in your row action handler will do the trick.
Thanks, I'm very grateful Ricky, but I know how to create segues with IDs, I just wasn't sure where to put the code and if i needed some declaration. I have since figured that out with the help of @KrunalNagvadia 's answer. Thanks guys! Here's a follow-on question: Do i need to create a new segue, if the screen i'm going to is part of the UITabBarController? Can I just do the segue somehow through the UITabBarController? again pls note, i'm not advanced in coding, so my questions may be a bit low level.
– Jamakes
Mar 27 at 5:01
You can segue to theUITabBarController
, pass the information about which tab you want to select viaprepare(for:sender:)
, then select the right tab inviewDidLoad
of theUITabBarController
by changingselectedIndex
.
– Ricky Mo
Mar 27 at 5:07
Ok thanks Ricky, I'll try figure that out later today.
– Jamakes
Mar 27 at 5:41
Hey @Ricky, I'm forced to up-skill myself in Swift and I'm looking for a tutor for about two hour per week, Is this something you do or would consider? Thanks
– Jamakes
Mar 29 at 2:58
@Jamakes Nope, I'm not a tutor :-)
– Ricky Mo
Mar 29 at 3:05
|
show 1 more comment
In your storyboard, control click the yellow circle icon above the view controller and drag to the destination view controller to create a segue.
Select the segue and give it an identifier
Now you can call performSegue(withIdentifier:sender:)
in your first view controller to segue programatically. In your case, put
self.performSegue(withIdentifier: "yourCustomSegue", sender: nil)
in your row action handler will do the trick.
In your storyboard, control click the yellow circle icon above the view controller and drag to the destination view controller to create a segue.
Select the segue and give it an identifier
Now you can call performSegue(withIdentifier:sender:)
in your first view controller to segue programatically. In your case, put
self.performSegue(withIdentifier: "yourCustomSegue", sender: nil)
in your row action handler will do the trick.
answered Mar 27 at 4:00
Ricky MoRicky Mo
2,4721 gold badge2 silver badges13 bronze badges
2,4721 gold badge2 silver badges13 bronze badges
Thanks, I'm very grateful Ricky, but I know how to create segues with IDs, I just wasn't sure where to put the code and if i needed some declaration. I have since figured that out with the help of @KrunalNagvadia 's answer. Thanks guys! Here's a follow-on question: Do i need to create a new segue, if the screen i'm going to is part of the UITabBarController? Can I just do the segue somehow through the UITabBarController? again pls note, i'm not advanced in coding, so my questions may be a bit low level.
– Jamakes
Mar 27 at 5:01
You can segue to theUITabBarController
, pass the information about which tab you want to select viaprepare(for:sender:)
, then select the right tab inviewDidLoad
of theUITabBarController
by changingselectedIndex
.
– Ricky Mo
Mar 27 at 5:07
Ok thanks Ricky, I'll try figure that out later today.
– Jamakes
Mar 27 at 5:41
Hey @Ricky, I'm forced to up-skill myself in Swift and I'm looking for a tutor for about two hour per week, Is this something you do or would consider? Thanks
– Jamakes
Mar 29 at 2:58
@Jamakes Nope, I'm not a tutor :-)
– Ricky Mo
Mar 29 at 3:05
|
show 1 more comment
Thanks, I'm very grateful Ricky, but I know how to create segues with IDs, I just wasn't sure where to put the code and if i needed some declaration. I have since figured that out with the help of @KrunalNagvadia 's answer. Thanks guys! Here's a follow-on question: Do i need to create a new segue, if the screen i'm going to is part of the UITabBarController? Can I just do the segue somehow through the UITabBarController? again pls note, i'm not advanced in coding, so my questions may be a bit low level.
– Jamakes
Mar 27 at 5:01
You can segue to theUITabBarController
, pass the information about which tab you want to select viaprepare(for:sender:)
, then select the right tab inviewDidLoad
of theUITabBarController
by changingselectedIndex
.
– Ricky Mo
Mar 27 at 5:07
Ok thanks Ricky, I'll try figure that out later today.
– Jamakes
Mar 27 at 5:41
Hey @Ricky, I'm forced to up-skill myself in Swift and I'm looking for a tutor for about two hour per week, Is this something you do or would consider? Thanks
– Jamakes
Mar 29 at 2:58
@Jamakes Nope, I'm not a tutor :-)
– Ricky Mo
Mar 29 at 3:05
Thanks, I'm very grateful Ricky, but I know how to create segues with IDs, I just wasn't sure where to put the code and if i needed some declaration. I have since figured that out with the help of @KrunalNagvadia 's answer. Thanks guys! Here's a follow-on question: Do i need to create a new segue, if the screen i'm going to is part of the UITabBarController? Can I just do the segue somehow through the UITabBarController? again pls note, i'm not advanced in coding, so my questions may be a bit low level.
– Jamakes
Mar 27 at 5:01
Thanks, I'm very grateful Ricky, but I know how to create segues with IDs, I just wasn't sure where to put the code and if i needed some declaration. I have since figured that out with the help of @KrunalNagvadia 's answer. Thanks guys! Here's a follow-on question: Do i need to create a new segue, if the screen i'm going to is part of the UITabBarController? Can I just do the segue somehow through the UITabBarController? again pls note, i'm not advanced in coding, so my questions may be a bit low level.
– Jamakes
Mar 27 at 5:01
You can segue to the
UITabBarController
, pass the information about which tab you want to select via prepare(for:sender:)
, then select the right tab in viewDidLoad
of the UITabBarController
by changing selectedIndex
.– Ricky Mo
Mar 27 at 5:07
You can segue to the
UITabBarController
, pass the information about which tab you want to select via prepare(for:sender:)
, then select the right tab in viewDidLoad
of the UITabBarController
by changing selectedIndex
.– Ricky Mo
Mar 27 at 5:07
Ok thanks Ricky, I'll try figure that out later today.
– Jamakes
Mar 27 at 5:41
Ok thanks Ricky, I'll try figure that out later today.
– Jamakes
Mar 27 at 5:41
Hey @Ricky, I'm forced to up-skill myself in Swift and I'm looking for a tutor for about two hour per week, Is this something you do or would consider? Thanks
– Jamakes
Mar 29 at 2:58
Hey @Ricky, I'm forced to up-skill myself in Swift and I'm looking for a tutor for about two hour per week, Is this something you do or would consider? Thanks
– Jamakes
Mar 29 at 2:58
@Jamakes Nope, I'm not a tutor :-)
– Ricky Mo
Mar 29 at 3:05
@Jamakes Nope, I'm not a tutor :-)
– Ricky Mo
Mar 29 at 3:05
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55369502%2fhow-do-i-add-a-second-action-segue-to-a-uialertaction-action%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Just insert the line for the segue after the download process complete or may in completion handler if any.
– Krunal Nagvadia
Mar 27 at 3:53