0

Mainly, my iphone application right now is a UIviewController with navigation buttons, logo, and title on the top of the screen. Inside this controller is a container view, which has an embedded navigation controller which leads to a series of table views that the user can navigate through. On the parent view, there is a back button that causes the inner navigaion controller to call popViewController and also updates the title of the screen on the outer view. This all works correctly, but when the user clicks the back button quickly, the naviagtion controller will already be in motion and “pop” again, but the title will update, causing the pages to become out of sync.

I have tried to block the back button and even used completion handlers, but nothing seems to work. Is there really no way for me to be able to prevent the back button from being clicked while the inner navigation controller is busy?

George
  • 25,988
  • 10
  • 79
  • 133
  • How / where are you "updating the title in the outer view"? If it's part of your "back button" code, that's likely the problem. You should probably use a delegate pattern so the VC "popped to" in your "inner nav controller" tells the "outer view" to change the title. – DonMag Jul 31 '18 at 15:42
  • Yeah thats exactly what im doing. I update the title on the back button being pressed. So you are saying to have the title updated when the view is popped? How can i add code to popviewcontroller? Override it? – Matt Galloway Jul 31 '18 at 16:01
  • I would expect the place to put it would be in `viewDidAppear()` in the table view controllers. – DonMag Aug 01 '18 at 13:23

0 Answers0