Closed RyogaK closed 7 years ago
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.
@scottrhoyt That makes sense. your approach sounds good to me. Thank you!
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 😆