Problem:
method of anonymous instance not called.
let dest = SomeController()
dest.modalPresentationStyle = .custom
//new instance, animationController will not be called
detail.transitioningDelegate = SomeDelegate()
present(detail, animated: true, completion: nil)
Cause:
weak reference
Solution:
extract instance to class property
...
fileprivate let mDelegate = SomeDelegate()
...
let dest = SomeController()
dest.modalPresentationStyle = .custom
detail.transitioningDelegate = self.mDelegate
present(detail, animated: true, completion: nil)
网友评论