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

animations with al and stack views
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Animations with AL (and stack views)

Marin Todorov

slide-2
SLIDE 2
slide-3
SLIDE 3

Swift 2.0 Swift 2.0

slide-4
SLIDE 4
slide-5
SLIDE 5

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

slide-6
SLIDE 6

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!

slide-7
SLIDE 7
slide-8
SLIDE 8

Demo…

slide-9
SLIDE 9

AutoLayout

UIView1 UIView2

Constraint Width Constraint Height Constraint CenterX Constraint MarginY Constraint Ratio Constraint Height Constraint Vert. Space

Layout Hierarchy

UIView1.center UIView1.bounds UIView2.center UIView2.bounds

UIView1.height = UIView2.height * 0.5 + 100

slide-10
SLIDE 10

AutoLayout

VC pushed VC popped

  • rientation


change keyboard
 pops up change
 constraint

AutoLayout AutoLayout AutoLayout

Internal & External changes

loadView()

slide-11
SLIDE 11

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

slide-12
SLIDE 12

AutoLayout

UIView1 UIView2

Constraint Width Constraint Height Constraint CenterX Constraint MarginY Constraint Ratio Constraint Height Constraint Vert. Space

Layout Hierarchy

UIView1.center UIView1.bounds UIView2.center UIView2.bounds

UIView1.height = UIView2.height * 0.5 + 100

slide-13
SLIDE 13

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

slide-14
SLIDE 14

Demo…

slide-15
SLIDE 15

UIStackView

Button

Constraint Width Constraint Height Constraint CenterX Constraint MarginY Constraint Ratio Constraint Height Constraint Vert. Space

AutoLayout Text

horizontal/vertical centered margin space

consult prev. slides

slide-16
SLIDE 16

Demo…

slide-17
SLIDE 17

Marin Todorov

Thank you!

www.underplot.com

slide-18
SLIDE 18