animations with al and stack views
play

Animations with AL (and stack views) Marin Todorov Swift 2.0 Swift - PowerPoint PPT Presentation

Animations with AL (and stack views) Marin Todorov Swift 2.0 Swift 2.0 UIView.animateWithDuration(1.0, animations: { redSquare.center.x = 200.0 }) Stack Overflow Q: How to do this one animation thing in my app? A: Include


  1. Animations with AL (and stack views) Marin Todorov

  2. Swift 2.0 Swift 2.0

  3. UIView.animateWithDuration(1.0, animations: { redSquare.center.x = 200.0 
 })

  4. 
 
 Stack Overflow Q: How to do this one animation thing in my app? 
 A: Include Bloated.framework by Super Awesome Ninja Dev 
 and paste: 
 createANM().move().byX(20).byY(10).fadeWithTint().etc().etc() Q: Accepted! Works!

  5. Demo…

  6. AutoLayout Layout Hierarchy UIView1.center Constraint Width Constraint Height UIView1.bounds Constraint CenterX UIView2.center UIView1 Constraint MarginY Constraint Ratio UIView2 UIView2.bounds Constraint Height Constraint Vert. Space UIView1.height = UIView2.height * 0.5 + 100

  7. Internal & External changes AutoLayout AutoLayout AutoLayout AutoLayout orientation 
 change 
 change constraint loadView() keyboard 
 pops up VC pushed VC popped

  8. view.center.x += 10 UIView.animateWithDuration(1.0, animations: { view.center.x -= 10 })

  9. AutoLayout Layout Hierarchy UIView1.center Constraint Width Constraint Height UIView1.bounds Constraint CenterX UIView2.center UIView1 Constraint MarginY Constraint Ratio UIView2 UIView2.bounds Constraint Height Constraint Vert. Space UIView1.height = UIView2.height * 0.5 + 100

  10. … code to change constraints… UIView.animateWithDuration(1.0, animations: { layoutIfNeeded() })

  11. Demo…

  12. horizontal/vertical UIStackView centered margin space Constraint Width Constraint Height Constraint CenterX Button Constraint MarginY Constraint Ratio Constraint Height Constraint Vert. Space Text AutoLayout consult prev. slides

  13. Demo…

  14. Thank you! Marin Todorov www.underplot.com

Recommend


More recommend