Skip to content

Instantly share code, notes, and snippets.

View licvido's full-sized avatar

Filip Mikovcak licvido

View GitHub Profile
@licvido
licvido / gist:87c1eee32b90b44d0b7e2fa09ea63cc7
Last active January 10, 2018 19:53 — forked from wavecos/gist:4dcb1410a41b9dd521cb
Present Modal ViewController when tap a TabBarItem (like camera VC in Instagram)
// 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