Closed ryancrunchi closed 6 years ago
When subclassing MZFormSheetPresentationViewController with a custom init it makes an infinite loop. Example (swift) :
MZFormSheetPresentationViewController
init
class MyPresentationViewController: MZFormSheetPresentationViewController { init() { let vc = MyViewController() super.init(contentViewController: vc) } }
This is due to MZFormSheetPresentationViewController initializer :
- (instancetype)initWithContentViewController:(UIViewController *)viewController { if (self = [self init]) { ...
which calls [self init] where self is the subclass, which itself is calling initWithContentViewController.
[self init]
self
initWithContentViewController
I'm preparing a PR to fix it : just replacing [self init] by [super init]. Edit : #162
[super init]
When subclassing
MZFormSheetPresentationViewController
with a custominit
it makes an infinite loop. Example (swift) :This is due to MZFormSheetPresentationViewController initializer :
which calls
[self init]
whereself
is the subclass, which itself is callinginitWithContentViewController
.I'm preparing a PR to fix it : just replacing
[self init]
by[super init]
. Edit : #162