Pro Yearly is on sale from $80 to $50! »

UIKit Dynamics

49f0cda85134c6aef960bf6a32f4e1c7?s=47 toco
December 11, 2013

UIKit Dynamics

A brief introduction to UIKit Dynamics.
Explains the base architecture and demonstrates the use of all framework provided behaviors.

Talk given at Alt Tech Talks Berlin (http://alt-tech-talks.com) – December 11th, 2013

The demo code is available on GitHub:
https://github.com/toco/Dynamic-ImageView
https://github.com/toco/Collisiontest

49f0cda85134c6aef960bf6a32f4e1c7?s=128

toco

December 11, 2013
Tweet

Transcript

  1. ! UIKit Dynamics Tobias Conradi !1 Alt Tech Talks Berlin

    December 11th, 2013
  2. What is UIKit Dynamics? !2

  3. 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

  4. Motivation !4

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

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

  7. Architecture !7

  8. Architecture !8 referenceView UIDynamicAnimator UIView! UIView!

  9. UIDynamicAnimator • Needs a reference view [[UIDynamicAnimator alloc] initWithReferenceView:referenceView]; •

    Add behavior to animator [animator addBehavior:someBehavior] !9
  10. UIDynamicBehavior UIDynamicBehavior Architecture !10 referenceView UIDynamicAnimator UIView! UIView!

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

  12. UIDynamicBehavior !12 UIDynamicItemBehavior UISnapBehavior UIPushBehavior +UIGravityBehavior +UICollisionBehavior

  13. UIDynamicBehavior • Add own behavior by using action-Block • Compose

    behaviors [behavior addChildBehavior:otherBehavior] • Subclassing makes the use compositions easier !13
  14. referenceView Architecture !14 UIDynamicBehavior UIDynamicAnimator UIDynamicBehavior UIView! UIView! <UIDynamicItem> <UIDynamicItem>

  15. UIDynamicItem • Protocol • bounds (readonly) • center • transform

    • Implemented by: • UIView • UICollectionViewLayoutAttributes !15
  16. Implementation !16

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

  18. Demo !18

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

  20. 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
  21. Contact Twitter: @toco91 github.com/toco/ xing.com/profiles/Tobias_Conradi3/ !21