简体   繁体   中英

Tab bar controller push segue instead (Swift)

I don't really know how to explain this but i have a tab bar controller and a qr code scanner controller, how can i make it perform a segue to the qr code scanner (exactly like the Instagram camera, when u tap on the camera icon, the whole tab bar disappears and segue to the camera page) instead of just tapping it. Thank you in advance for reading this.

Image of Storyboard

  1. Don't link QR scanner controller into tabbar.
  2. Link some empty VC to 3-d tab
  3. Setup delegate for your tabbar controller
  4. implement method:

     public func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { if tabBarController.viewControllers!.last == viewController { // present your vc return false } return true } 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM