Slide 1

Slide 1 text

! UIKit Dynamics Tobias Conradi !1 Alt Tech Talks Berlin December 11th, 2013

Slide 2

Slide 2 text

What is UIKit Dynamics? !2

Slide 3

Slide 3 text

http://blog.bignerdranch.com/3899-uikit-dynamics-and-ios-7-building-uikit-pong/ http://www.teehanlax.com/blog/introduction-to-uikit-dynamics/ ✗ ✔ Not for UIKit-games! !3

Slide 4

Slide 4 text

Motivation !4

Slide 5

Slide 5 text

Tweetbot 3 for iOS 7 !5 http://tapbots.com/software/tweetbot/

Slide 6

Slide 6 text

Tweetbot 3 for iOS 7 !6 http://tapbots.com/software/tweetbot/

Slide 7

Slide 7 text

Architecture !7

Slide 8

Slide 8 text

Architecture !8 referenceView UIDynamicAnimator UIView! UIView!

Slide 9

Slide 9 text

UIDynamicAnimator • Needs a reference view [[UIDynamicAnimator alloc] initWithReferenceView:referenceView]; • Add behavior to animator [animator addBehavior:someBehavior] !9

Slide 10

Slide 10 text

UIDynamicBehavior UIDynamicBehavior Architecture !10 referenceView UIDynamicAnimator UIView! UIView!

Slide 11

Slide 11 text

UIDynamicBehavior !11 UIAttachmentBehavior UICollisionBehavior UIGravityBehavior +UIGravityBehavior https://developer.apple.com/library/ios/samplecode/DynamicsCatalog/

Slide 12

Slide 12 text

UIDynamicBehavior !12 UIDynamicItemBehavior UISnapBehavior UIPushBehavior +UIGravityBehavior +UICollisionBehavior

Slide 13

Slide 13 text

UIDynamicBehavior • Add own behavior by using action-Block • Compose behaviors [behavior addChildBehavior:otherBehavior] • Subclassing makes the use compositions easier !13

Slide 14

Slide 14 text

referenceView Architecture !14 UIDynamicBehavior UIDynamicAnimator UIDynamicBehavior UIView! UIView!

Slide 15

Slide 15 text

UIDynamicItem • Protocol • bounds (readonly) • center • transform • Implemented by: • UIView • UICollectionViewLayoutAttributes !15

Slide 16

Slide 16 text

Implementation !16

Slide 17

Slide 17 text

Attachment, Push, Snap & Collision !17 https://github.com/toco/Dynamic-ImageView

Slide 18

Slide 18 text

Demo !18

Slide 19

Slide 19 text

Gravity, Collision & DynamicItemBehavior !19 https://github.com/toco/Collisiontest

Slide 20

Slide 20 text

More Information • WWDC 2013 Session 206:
 Getting Started with UIKit Dynamics • WWDC 2013 Session 221:
 Advanced Techniques with UIKit Dynamics • https://developer.apple.com/library/ios/samplecode/DynamicsCatalog/ • http://www.teehanlax.com/blog/introduction-to-uikit-dynamics/ • https://github.com/toco/Collisiontest • https://github.com/toco/Dynamic-ImageView • https://github.com/toursprung/TSMessages !20

Slide 21

Slide 21 text

Contact Twitter: @toco91 github.com/toco/ xing.com/profiles/Tobias_Conradi3/ !21