Describe the bug
On iOS 14 sim/device, when launching the app in logged out state, an initialized tab bar UI is shown briefly before the authentication UI is shown.
To Reproduce
On an iOS 14 simulator or device:
Screenshots

Expected behavior
The authentication UI should be shown immediately after the launch screen.
Isolating the problem (mark completed items with an [x]):
Mobile Environment
Please include:
I started looking into this issue, and it looks like presenting a view controller on launch always shows the presenting view controller (MainTabBarController in this case) briefly even without animation. This is somehow not noticeable/obvious before iOS 14 probably due to some internal app launch changes.
The SO discussions I've found suggest adding the launch screen to the presenting view controller as a subview, which feels quite hacky to me.
One interesting observation: if I replaced the login presentation with presenting a plain UIViewController from either the main app or WPAuthenticator, the flash somehow does not happen. There could be something in how the login UI is set up in WPAuthenticator that contributes to the delayed presentation like Storyboard, but it is certainly not an easy task to pull the view controllers from the Storyboard.
Instead of having MainTabBarController presenting the login view controller on launch, we can set the window's rootViewController to the login view controller so that there is no animation involved either. There are a few places that require changes:
WordPressAuthenticator's showLogin function currently performs the presentViewController, and we need to add another function to return the login view controller instead of "showing" it.AppCoordinator now has to take in the app UIWindow from AppDelegate, and only replace the window's rootViewController when displaying the authenticator without animation. It also has to set the window's rootViewController back to MainTabBarController in logged in state.I foresee extensive testing for this change, and I'll dig into implementation next week! With the app navigation encapsulated in AppCoordinator, it is a bit easier to make these changes with unit tests.
Instead of having MainTabBarController presenting the login view controller on launch, we can set the window's rootViewController to the login view controller so that there is no animation involved either. There are a few places that require changes:
I agree with this. If possible, I think it's much better if MainTabBarController does not exist in memory at all if the user is not logged in. Not sure what the repercussions are though. 馃槵
I came here to report and found this 馃榾.
Just noting that WPiOS also has a glitchy launch/splash animation https://github.com/wordpress-mobile/WordPress-iOS/issues/15399, so if the solution ends up being in a shared library, all the better.
For reference, WPiOS's issue is that the tab bar screen is visible for a split-second, which looks similar to what's happening here.
|
|
| - |
Most helpful comment
I came here to report and found this 馃榾.
Just noting that WPiOS also has a glitchy launch/splash animation https://github.com/wordpress-mobile/WordPress-iOS/issues/15399, so if the solution ends up being in a shared library, all the better.
For reference, WPiOS's issue is that the tab bar screen is visible for a split-second, which looks similar to what's happening here.
|
|
| - |