square/SuperDelegate

setup(mainWindow:) shouldn't set UIWindow's bounds on iOS9+

TadeasKriz opened this issue · 5 comments

When setting UIWindow's bounds to UIScreen.main.bounds it breaks apps on iPads with iOS 9 and higher. This is caused because of the multitasking feature introduced in iOS 9. Setting those bound make the app appear under the status bar. Having just makeKeyAndVisible results in correct behavior.

dfed commented

Seems reasonable. What's the bounds on iPads? Is it .zero? Could we just set the bounds if it isn't zero?

dfed commented

Revisiting this: obviously the bounds are not .zero. Are the bounds just set for us? Or does the client need to retrieve it somehow?

As far as I understand Apple's docs, you shouldn't set UIWindow's bounds and also should use its bounds when you need to work with bounds of the app (instead of using UIScreen.main.bounds). I'll do a bit more investigation on the bounds value later today and let you know.

Any news on that @TadeasKriz ?

I just did a bit of testing. Sadly we do not have any devices supporting iOS < 9. As Apple discontinued those, it may be okay to set the minimum deployment target to iOS 9. As far to my knowledge, if we do this, we do not need to set the UIWindow bounds. Here, it works for every iPhone / iPad which are currently supported by Apple.