Unwind Segue in Xcode 6.1.1 with storyboard

前端 未结 4 2171
广开言路
广开言路 2021-02-20 13:26

I have been reading that unwind segue\'s are bugged in Xcode 6. I am using Xcode 6.1.1 and I use swift.

I use the \"Back\" button that is put by the navigation controlle

4条回答
  •  余生分开走
    2021-02-20 13:54

    Got it working. If you are presenting from a NavigationController or TabBarController(unsure about the TabBarController), you need to subclass the navigation controller and add the unwind segue to that. In storyboard don't forget to change the class of your navigation controller. My view hierarchy was NavController -> TableController -> DetailController. After adding method to custom NavBar class add it to the VC you want to RETURN to. You will then be able to ctrl-drag to exit. I consider this a bug, as once it is hooked up I was able to delete the subclass and return to stock NavigationController and it still worked.

提交回复
热议问题