mirror of
https://github.com/UrbanApps/Armchair.git
synced 2026-01-14 14:23:25 +01:00
getRootViewController won't work correctly. #49
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RyogaK on GitHub (Oct 20, 2016).
I'm not in detail, but nextResponder of the item in keyWindow.subviews is keyWindow in my case.
I think it should be discussed.
How about use following logic?
At least, the following works for me.
I can make pull request if needed 😆
@scottrhoyt commented on GitHub (Feb 13, 2017):
I'm not sure iterating through the view controllers is the right approach. There are a lot of assumptions that need to be made, and even then the view controller you find might not currently be in the right state to present a modal because it is in the process of transitioning.
Perhaps a better approach would be to create a new window with an empty view controller as root and present from that view controller. The dismissal of the modal can then hide the widow and release it. This is the approach that I have used in situations like this and it works well.
@RyogaK commented on GitHub (Feb 14, 2017):
@scottrhoyt That makes sense. your approach sounds good to me. Thank you!