Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Learn swiftla animations

84 views

Published on

Some info on animations

Published in: Software
  • Be the first to comment

  • Be the first to like this

Learn swiftla animations

  1. 1. ANIMATION BASICS LEARNSWIFTLA - RAGHAV MANGROLA
  2. 2. ANIMATION BASICS BIRTH OF A VIEW CONTROLLER ▸ viewDidLoad ▸ viewWillAppear ▸ viewDidAppear http://stackoverflow.com/a/5109277
  3. 3. ANIMATION BASICS VIEWWILLAPPEAR override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) loginButton.center.x -= view.bounds.width }
  4. 4. ANIMATION BASICS https://developer.apple.com/reference/uikit/uiview#symbols ▸ Bounds ▸ Rectangle which describes the views location and size in it's own coordinate system ▸ Frame ▸ Rectangle which describes the views location and size in its superview's coordinate system ▸ Center ▸ The center of the frame BOUNDS AND FRAMES
  5. 5. ANIMATION BASICS VIEWDIDAPPEAR override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) UIView.animate(withDuration: 5, delay: 0, options: [], animations: { self.loginButton.center.x += self.view.bounds.width }, completion: nil) }
  6. 6. ANIMATION BASICS WHAT CAN WE ANIMATE? ▸ Position and Size ▸ Bounds ▸ Frame ▸ Center ▸ Appearance ▸ backgroundColor ▸ Change background color over time ▸ alpha ▸ Create fade in and fade out effects
  7. 7. ANIMATION BASICS ANIMATION EASING ▸ .curveEaseIn ▸ Applies acceleration to the start of your animation ▸ .curveEaseOut ▸ Applies acceleration to the end of your animation ▸ .curveEaseInOut ▸ Applies acceleration to the start and end of your animation

×