When the startup page advertisement is parallel to the root controller (UITabBarController), whether the startup page advertisement is loaded first or last, the root controller is always loaded first. The actual need is to load the startup page ads first (regardless of whether the ads are skipped or not) and then set the root controller. I tried delaying the setting of the root controller (waiting for the ad to load), and the program crashed, but it still didn't work.
I have considered this problem before, and there are currently two methods
1. Make the splash screen page into a VC and set it as the root view controller. Regardless of whether it is skipped or not, its next page will be
UITabBarController
, and turn off the jump animation.I didn’t use this solution later, I forgot the specific situation
2. Make a
UIView
, use a full-screenUIView
to block the entire interface whenUITabBarController
is initialized, and then remove it after a certain period of time or when you click to skip. This solution is also the one I use, and one of the important points is The purpose is to cache advertising images, give priority to displaying cached advertising images to prevent them from being too large and slow in loading, and then perform asynchronous download operations at the right time