Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make STPopupContainerViewController public #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rokoroku
Copy link

@rokoroku rokoroku commented Nov 5, 2015

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.

@kevin-lyn
Copy link
Owner

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

@rokoroku
Copy link
Author

rokoroku commented Nov 7, 2015

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.

@kevin-lyn
Copy link
Owner

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

@rokoroku
Copy link
Author

rokoroku commented Nov 7, 2015

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

@bawn
Copy link

bawn commented May 18, 2017

+1

1 similar comment
@Errortype520
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants