Reputation: 97
1:
I'm trying to animate a zoom out/size change of a UIImageView
. Below is how I want the launch screen to look and then once it's loaded to go onto my HomeViewController
.
2:
Because (at the moment) I'm doing the animation on the HomeViewController
which I know isn't the right way to do it, the buttons on my VC
instantly appear as the animation is happening
3:
And finally, this is almost how I want it to look, but to achieve this, I've put a UIView
which covers the buttons but not the logo and have animated it to fade as if the buttons were fading in.
So how would I do the initial animation on the launch screen before loading my HomeViewController
? I can't seem to add my UIImageView
onto my AppDelegate.swift
to do the animation there, many thanks!
CODE: (in viewDidLoad
of HomeViewController
)
let orginalY = self.imageView.center.y
UIView.animate(withDuration: 1.0, animations: {() -> Void in
self.imageView?.transform = CGAffineTransform(scaleX: 0.5, y: 0.5)
self.imageView.center.y = orginalY - 100
}, completion: nil)
UIView.animate(withDuration: 1.2) {
self.hidingView.alpha = 0
}
Upvotes: 0
Views: 1400
Reputation: 738
You cannot animate your LaunchScreen. Most of the apps in which you see animation actually have an intermediate controller/screen. Flow would be some thing like this.
Upvotes: 1
Reputation: 16341
You can't do custom animation on launchscreen storyboard. You will have to use a SplashViewController
before showing the HomeViewController
and in your completion block of the animation present the HomeViewController
in full screen.
Upvotes: 1