STPopup
STPopup copied to clipboard
make STPopupContainerViewController public
It’s necessary to make the popup container view controller public when we have to know the top-most view controller.
Without this, we should check the dynamic type of class which is less reliable.
@rokoroku I think you could get the top-most view controller by viewController.presentingViewController if you the "viewController" is in popup. viewController.presentingViewController is referring o the "containerViewController" in this case.
Of course we can get the top view controller is "STPopupContainerViewController", but we cannot check it by using isKindOfClass method because it's not a public class.
@rokoroku may I know why you would use isKindOfClass for checking the top-most view controller? Is it for detecting if a view controller is presented as a popup?
I usually handle a local notification by getting my navigation controller's top view controller when application is in active state. When a popup is opened, top view controller returns the popup controller. I have to know that it is instance of popup container controller or not so that I can skip it in getting the top view controller logic. (In short, I need to know the parent view controller of the popup controller.)
+1
+1