Created
January 28, 2015 23:13
-
-
Save wavecos/4dcb1410a41b9dd521cb to your computer and use it in GitHub Desktop.
Revisions
-
wavecos created this gist
Jan 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ // 1. First Create a Dummy UIViewController that has a root relation with the UITabBarController // 2. Make this controller implement a UITabBarControllerDelegate // 3. In ViewDidLoad: override func viewDidLoad() { super.viewDidLoad() self.tabBarController?.delegate = self } // 4. Implement this delegate method: func tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) { let isModalTab = viewController == self if isModalTab { let cameraVC = UIStoryboard.cameraVC() // 5. HERE YOU SPECIFY THE MODAL VIEW CONTROLLER!!! self.presentViewController(cameraVC, animated: true, completion: nil) } } // 5. That's all