Custom transition animation not calling VC lifecycle methods on dismiss

后端 未结 6 1522
梦谈多话
梦谈多话 2020-12-24 11:11

So I built a custom presenting transition animation and everything seems to be working great except the view controller lifecycle methods are not being called on dismiss.

6条回答
  •  天命终不由人
    2020-12-24 11:55

    If you are using UIModalPresentationCustom you should provide custom UIPresentationController class, and if you want to use ViewController lifecycle callers, you need to override shouldRemovePresentersView and return YES.

    If you would like to keep presenters and still have ViewControlelr lifecycle callback, you can override private method _shouldDisablePresentersAppearanceCallbacks and return NO in your custom UIPresentationController class.

提交回复
热议问题