Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close
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 9 |
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 }) } |
Be the first to comment.