Updated 22 April 2017
Apply animation to view is mandatory because by applying animation your app looks beautiful. You can set your view duration that how much time the animation will work and also set the delay time that your UIView will display on the screen, Here are some types of animation examples that you can apply to the view:-
1 2 3 4 |
UIView.animate(withDuration: 1, animations: { self.yourView.backgroundColor = .red } , completion : nil ) |
1 2 3 4 |
UIView.animate(withDuration: 1, animations: { self.yourView.frame.size.width += 20 self.yourView.frame.size.height += 20 } , completion : nil ) |
1 2 3 4 |
UIView.animate(withDuration: 1, animations: { self.yourView.frame.origin.x -= 50 self.yourView.frame.origin.y -= 50 } , completion : nil ) |
1 2 3 4 5 6 7 8 |
UIView.animate(withDuration: 1, animations: { self.yourView.frame.size.width += 20 self.yourView.frame.size.height += 20 }) { _ in UIView.animate(withDuration: 1, delay: 0.25, options: [.autoreverse, .repeat], animations: { self.yourView.frame.origin.y -= 50 }) } |
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.