STPopup icon indicating copy to clipboard operation
STPopup copied to clipboard

make STPopupContainerViewController public

Open rokoroku opened this issue 8 years ago • 6 comments

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 avatar Nov 05 '15 14:11 rokoroku

@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.

kevin-lyn avatar Nov 07 '15 04:11 kevin-lyn

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 avatar Nov 07 '15 05:11 rokoroku

@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?

kevin-lyn avatar Nov 07 '15 05:11 kevin-lyn

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.)

rokoroku avatar Nov 07 '15 05:11 rokoroku

+1

bawn avatar May 18 '17 07:05 bawn

+1

Errortype520 avatar May 09 '18 17:05 Errortype520