Showing posts with label animate. Show all posts
Showing posts with label animate. Show all posts

Friday, February 3, 2017

How to Create Animation Chains - UIView.animate (iOS, Xcode 8, Swift 3)

Need to do multiple animations, one after another? This video will show you a pretty good way on how to accomplish this using UIView.animate with the completion block.

Friday, November 4, 2016

Animation With Spring (Bounce)


Code Example

 
 
UIView.animate(withDuration: 0.2, 
    delay: 0, 
    usingSpringWithDamping: 0.5, 
    initialSpringVelocity: 0.5, 
    options: .curveEaseOut, 
    animations: {
    // Your animation
}, completion: nil)
 

Parameters

  • withDuration - How long the animation should last
  • delay - How long to wait until starting the animation
  • usingSpringWithDamping - Applies damping to the spring (bounce). Using 1 will completely damp out the spring so the animation just slides into place and stops. Lower the damping for more bounce (example: 0.1 - 0.9).
  • initialSpringVelocity - How fast you want the initial animation to happen. Using 1 will start it fast, 0 is normal. Apple says, "You'll typically want to pass 0 for the velocity."
  • options:
    • curveEaseInOut - Start slow, speed up, then slow down
    • curveEaseIn - ("In" specifies the start of the animation) Start slow, speed up, then suddenly stop
    • curveEaseOut - ("Out" specifies the end of the animation) start fast, then slow down until stop
    • curveLinear - Constant speed throughout animation

(Xcode 8, Swift 3.0)

Tuesday, November 1, 2016

Menus in Your Apps

In these videos I show you two options for creating menus that slide out from the side. The main thing I'm doing is using a UIView and animating the movement to show a menu.




Wednesday, October 26, 2016

Animating a Constraint

You want to animate the "layoutIfNeeded()" function after setting the constant on the constraint.
 
centerXConstraint.constant = 0

UIView.animate(withDuration: 0.2) {
    self.view.layoutIfNeeded()
}
 
(Xcode 8, Swift 3.0)

SwiftUI Search & Filter with Combine - Part 3 (iOS, Xcode 13, SwiftUI, 2...

In part 3 of the Searchable video series, I show you how to use Combine in #SwiftUI for the search and filter logic connected to the searcha...