Skip to content

make STPopupContainerViewController public#22

Open
rokoroku wants to merge 1 commit into
kevin-lyn:masterfrom
rokoroku:master
Open

make STPopupContainerViewController public#22
rokoroku wants to merge 1 commit into
kevin-lyn:masterfrom
rokoroku:master

Conversation

@rokoroku

@rokoroku rokoroku commented Nov 5, 2015

Copy link
Copy Markdown

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
Copy Markdown
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

rokoroku commented Nov 7, 2015

Copy link
Copy Markdown
Author

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
Copy Markdown
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

rokoroku commented Nov 7, 2015

Copy link
Copy Markdown
Author

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

bawn commented May 18, 2017

Copy link
Copy Markdown

+1

1 similar comment
@Errortype520

Copy link
Copy Markdown

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

4 participants