Closed Serproger closed 6 years ago
The situation is not reproduced. Can you tell me what circumstances?
This issue can be observed when UINavigationController is located inside DrawerController, I have controllers A and B in navigation stack and I press back button in B. ViewWillDisappear and ViewDidDisappear of B will be called, but in both of them drawerController property is equal to nil. If necessary, I'll prepare sample project.
UPD. Sorry, in this case the problem doesn't reproduce. I'll prepare another sample sample.
If that's what I understand:
DrawerController <- UINavigationController
UINavigationController <- A
UINavigationController <- B
Since A and B are not managed directly by DrawerController, nil
value is correct.
However, the drawerController
property of the UINavigationController will be not nil
.
But in other lifecycle methods drawerController is not nil
...
What is "other lifecycle"?
for example, viewDidLoad
.
I extended the range of drawerController property. #25 Is there a problem now?
Please see controller InnerContentController1 in this sample. drawerController is not nil in viewWillDisappear but it is nil in viewDidDisappear.
You should press button "GO", then button "Button", then press back button in navigation controller to reproduce.
I have tested the code. In viewDidDisappear, it is normal for the drawerController variable to be nil. Because there is no parentViewController at the time when viewDidDisappear is called.
OK, maybe it's the feature, not bug :)
Please update package in Cocoapods.
Extension property drawerController of UIViewController returns nil when I'm trying to access it in viewWillDisappear and viewDidDisappear methods of my view controller. Could you please explain this behaviour if it's correct or fix it if there is some bug?