Skip to content

Instantly share code, notes, and snippets.

@JeremyXue77
Created September 21, 2019 08:14
Show Gist options
  • Save JeremyXue77/0a301df0ae531cec8c648c72ea7fb094 to your computer and use it in GitHub Desktop.
Save JeremyXue77/0a301df0ae531cec8c648c72ea7fb094 to your computer and use it in GitHub Desktop.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
launchScreenAnimation()
}
private func launchScreenAnimation() {
guard let launchScreen = UIStoryboard(name: "LaunchScreen", bundle: nil).instantiateInitialViewController() else { return }
self.view.addSubview(launchScreen.view)
if let label = launchScreen.view.viewWithTag(1) as? UILabel {
UIView.animate(withDuration: 3,
delay: 0,
options: .curveEaseInOut ,
animations: {
label.text = "Hello"
launchScreen.view.alpha = 0
}) { (finished) in
launchScreen.view.removeFromSuperview()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment