ios - Return to root controller from another tab -


  • first tab
    • navigation controller
    • table controller
    • details controller
  • second tab
    • view controller

hello!

a user on first tab looks table controller , opens detail controller , proceeds second tab , there doing something. returning first tab sees detail controller needed there table controller! can done double tap first tab icon how programmatically?

thanks help!

you can use tabbar delegate this:

func tabbarcontroller(tabbarcontroller: uitabbarcontroller, didselectviewcontroller viewcontroller: uiviewcontroller) {     if tabbarcontroller.selectedindex == 0 {         let navigationcontroller = viewcontroller as? uinavigationcontroller         navigationcontroller?.poptorootviewcontrolleranimated(true)     } } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -