In the main screen of my iOS application I have a table view populated with a list of users from a web service, what I want to do is to show the table, and over it a modal view controller. I have everything set up, but I don't know how to present my "ModalVC" programatically from the main screen, and to do it after the table was populated? The code below is for presenting a normal view controller programmatically.
let vc : AnyObject! = self.storyboard!.instantiateViewControllerWithIdentifier("ModalVC")
self.showViewController(vc as! UIViewController, sender: vc)
Presenting a view controller of class name ModalVC programmatically
let modalVC = ModalVC.instantiateFromStoryboard(self.storyboard!)
self.presentViewController(modalVC, animated: true, completion: nil)
Swift 3:
let modalVC = ModalVC.instantiateFromStoryboard(self.storyboard!)
self.present(modalVC, animated: true, completion: nil)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With