iOS - UIView Animation in Swift

 
Maniisha Gorasiya


Animation is an important part of your iOS interfaces. Good UI animations can greatly improve UX(user experience) of a mobile app if it is done precisely.  An Amazing Animation attract the user toward things that change, and make your app’s UI/UX better & attractive. Beautiful animation throughout iOS builds a visual sense of connection between people and content onscreen.

This simple code for attractive animation. In this blog, you’ll learn how to use UIView animation to do the following:
- Animation for UIView (UIButton, Tableviewcell, UITextfield, UITextVIew, …)
- Create transform scale of animation
- Set the duration time of animation
- Delay time of animation

Full code of animation is here:

 yourView.transform = CGAffineTransform(scaleX: 0.1, y: 0.1)  // set x and y position of scale

UIView.animate(withDuration: 2.0, delay: 0, usingSpringWithDamping: 0.7,
initialSpringVelocity: 6.0,options: .allowUserInteraction,
animations: { [weak self] in
yourView.transform = .identity

},
completion: nil)

This animation looks more attractive in UITableViewCell because the cell also animate on scroll.




Comments

No Comment

Leave a Comment

Your email address will not be published.



#212, JV Square 2, Sanskar Nagar, Bhuj-370001, Gujarat
+(91) 97 26 134340
Mon-Fri 9:00am-6:00pm
talk@lpktechnosoft.com
24 X 7 online support