set the original root window back to key and visible#7
set the original root window back to key and visible#7shyal wants to merge 1 commit intodbettermann:masterfrom shyal:master
Conversation
|
Thanks for the pull request. I appreciate it. Are you trying to show other UIViewControllers in the window that DBAlertController creates, or are you trying to create multiple UIWindows? I'm not sure what issue you're running into. Can you elaborate? The UIWindow that was shown before presenting DBAlertController will become key and visible again when DBAlertController is dismissed. This is because there are no longer any strong references to DBAlertController's window and the window is deallocated. |
|
Hi Dylan, I’m actually using your script with a Eureka form: import UIKit The DBAlertController instance is presented on the rootViewController Which is just a UIViewController. To my delight it worked, but I noticed I thought it might be because my initial app’s window was no longer key I’m pretty new to Swift, so me at this point having no idea what I’m doing I’ve got quite a few UIAlertControllers, and Eureka based popup windows I hope this explains things a little better. Regards, OSB On 6 November 2015 at 18:06, Dylan Bettermann notifications@github.com
|
|
Makes sense. It sounds like you still have a strong reference to DBFormController even after you dismiss it. That means that there's still a strong reference to the window and thus the window is still showing. So the reason you can't interact with the UI is because the window or the DBClearViewController is intercepting your touches. In summary, both of your assumptions are right.
While your changes don't quite fix the problem, your idea is still correct. I'll have to think about this one. Thanks again. |
|
Yeah I wasn't really expecting you to merge it anyway as it doesn't address Take care. On 6 November 2015 at 23:29, Dylan Bettermann notifications@github.com
|
|
No problem. I'm sure someone else will find value in this conversation. I'm going to keep this issue open until I figure something out. |
DBAlertController can be used with more than just UIAlertController, but for this to work properly it requires setting the root window back to key and visible on dismiss. I'm using this code but please test thoroughly.