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 Bloated.framework by Super Awesome Ninja Dev and paste: createANM().move().byX(20).byY(10).fadeWithTint().etc().etc() Q: Accepted! Works!
Demo…
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
Internal & External changes AutoLayout AutoLayout AutoLayout AutoLayout orientation change change constraint loadView() keyboard pops up VC pushed VC popped
view.center.x += 10 UIView.animateWithDuration(1.0, animations: { view.center.x -= 10 })
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
… code to change constraints… UIView.animateWithDuration(1.0, animations: { layoutIfNeeded() })
Demo…
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
Demo…
Thank you! Marin Todorov www.underplot.com
Recommend
More recommend