Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating new UIWindows, taking over key window -- bad practice?

I'm working on an app which needs to display an overlay an top of everything else. It does this by creating a new UIWindow, and using makeKeyAndVisble to "take over" the screen. When it's done, it gives control back back to the original UIWindow.

Is this a bad thing to do? It feels like it's taking control of the app at a low level, which is generally bad; on the other hand, it's very straightforward to do, so maybe it's perfectly acceptable.

Opinions/experiences?

like image 230
Anna Dickinson Avatar asked Oct 06 '22 05:10

Anna Dickinson


1 Answers

In my experience it is perfectly fine to add another UIWindow on top of the default one.

I also do not think that this is like taking control of the app at a low level. If I consider that the iOS SDK is closely related to the MacOS SDK, I tend to think that multiple window are perfectly supported at a higher level of abstraction: it is only that on iOS they are not so necessary or useful (generally speaking, apart from specific cases).

Digging a bit on the web, I found this interesting discussion on S.O.

Hope it helps.

like image 165
sergio Avatar answered Oct 07 '22 19:10

sergio