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

Include childModalViewControllers when checking rmq.app.current_view_controller #314

Open
HealsCodes opened this issue Jan 29, 2016 · 0 comments

Comments

@HealsCodes
Copy link
Contributor

I know the topic of detecting the current view controller is a hairy one (I had my fair share of it).
But would it be possible to extend rmq.app.current_view_controller and in that respect rmq.view_controller to check and respect if a view has an active childModalViewController?

As it is right it's not possible to use presentViewController with any of both methods if a there is currently a modal view controller on screen.

I know it sounds strange but one real world use case would be displaying a UIAlertController from a modal view. I came across this while debugging a missing alert box from RedAlert.
Turns out rmq.view_controller is the culprit as it doesn't traverse down my modal VC resulting in an error like this:

Warning: Attempt to present <UIAlertController: 0x11e10c7f0> on <StartScreen: 0x12325fe50> whose view is not in the window hierarchy!

StartScreen in this case is the VC below my current modal screen.
There's currently an open issue on this for RedAlert but IMHO the real fix belongs in RMQ.

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

No branches or pull requests

1 participant