Navigation stack becomes unusable after canceling iOS 7 back swipe gesture

后端 未结 5 1193
长发绾君心
长发绾君心 2020-12-13 19:02

I am running into an issue where my navigation controller becomes unusable after initiating then canceling the new iOS 7 back swipe gesture.

Some relevant informatio

5条回答
  •  执念已碎
    2020-12-13 19:54

    I had the same problem, and after searching around, it looks like you can't get a notification if the gesture is cancelled. There is no -shouldCancel on the gesture recognizer delegate, and there is no -willReshowViewController on the navigation controller. So I have the view controller that needs the navigation bar shown (i.e. the controller that is being cancelled on) set self.navigationController.navigationBarHidden = NO in -viewWillAppear. That way when the gesture is cancelled and -viewWillAppear is called, the navigation bar will be unhidden again. As far as I can tell, this is the only way to have both the swipe-back gesture and shown/hidden navigation bars without a problem when cancelling the gesture.

提交回复
热议问题