uchicago-mobi / 2015-Winter-Forum

8 stars 1 forks source link

about Navigation Controller #175

Closed xiaoyifan closed 9 years ago

xiaoyifan commented 9 years ago

screen shot 2015-02-27 at 9 04 06 pm

As shown on the screen shot, I embed the detailViewController in the NavigationController, and the MainViewController on the left is not. What I want to achieve is when the user tap the tableViewcell on the mainViewController, it will segues to the detailVC. It's done. But how can I go back with tapping on the X button? I can't use unwind cuz mainVC is not embed in NavigationVC.

I tried to use dismissViewController, but it seems, if I go back to mainVC, I can segue to detailVC instantly. I guess that's because the allocation and deallocation of VC takes time.

So any advice?

Thanks

tabinks commented 9 years ago

You should embed master in the navigation controller. Unless I'm missing something this is perfect example of using unwind segue.

xiaoyifan commented 9 years ago

Yep. I'm trying to get rid of the Navigation controller, cuz the customization on the NavigationBar is limited, so I wanna implement this without navigationController. I just used the dismiss method, it works. And I can do data saving in viewWillDisappear

tabinks commented 9 years ago

Don't forget, you can hide the navigation bar while still having the view controllers embedded in a navigation controller. You could create the interface how ever you want and just call the normal navigation controller behaviors from those. Just an option...

xiaoyifan commented 9 years ago

OH MY!!!I forgot this~~~I just implemented by pushing VC and dismiss it later. thank U so much!