Reputation: 2570
I have a modal pop open when a user clicks a button using UIAlertController.
let agreeAction = UIAlertAction(title: "Agree", style: .Default, handler: nil)
Currently the handler is set to nil, but I would like for it to take the user to a viewcontroller in another storyboard. I tried the following which does not seem to work.
handler: UIViewController *theInitialViewController = [secondStoryBoard otherViewController];
Any direction or suggestions would be greatly appreciated.
Upvotes: 2
Views: 256
Reputation: 12254
The handler
parameter is a block that takes a UIAlertAction
and returns Void
. Your handler parameter should therefore look something like this:
{(alert: UIAlertAction!) in
self.performSegueWithIdentifier("segueId", sender: self);
})
For future reference: UIAlertController Class Reference
Upvotes: 1