0

I am using this Github-Repo for a reavealing splash view.

I am calling it like this inside my AppDelegate:

let revealingSplashView = RevealingSplashView(iconImage: UIImage(named: "wIcon")!, iconInitialSize: CGSize(width: 120 * UIScreen.main.bounds.width / 414.0, height: 120 * UIScreen.main.bounds.width / 414.0), backgroundColor: .white)

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    revealingSplashView.startAnimation()
    window?.rootViewController?.view.addSubview(revealingSplashView)
    
    return true
}

I am facing an issue where sometimes after the animation is finished, it is not instantly transitioning to the other ViewController but showing a blank white screen.

Here is a screen-video for a better understanding.

Does anyone have an idea what can cause that?

Or is there an easy way to implement it without this repo?

Chris
  • 1,828
  • 6
  • 40
  • 108

1 Answers1

0

You calling the revealingSplashView inside AppDelegate didFinishLaunchingWithOptions. If you check the documentation they clearly state to call it in the viewDidLoad method of your viewController. Your view has not been loaded that's why you got the delay.

Check the documentation which you linked above:

import RevealingSplashView

override func viewDidLoad() {
        super.viewDidLoad()

        //Initialize a revealing Splash with with the iconImage, the initial size and the background color
        let revealingSplashView = RevealingSplashView(iconImage: UIImage(named: "twitterLogo")!,iconInitialSize: CGSize(width: 70, height: 70), backgroundColor: UIColor(red:0.11, green:0.56, blue:0.95, alpha:1.0))

        //Adds the revealing splash view as a sub view
        self.view.addSubview(revealingSplashView)
davidev
  • 7,694
  • 5
  • 21
  • 56
  • ok makes sense, but the thing is that I always want that view to be the first shown. But I have different `rootViewControllers` depending wether the user is logged in or not – Chris Nov 18 '20 at 13:25