Slide 1

Slide 1 text

Physics-Based Interfaces with UIKit Dynamics Adam May @yammada ! Sam Kirchmeier @skirchmeier

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Agenda

Slide 5

Slide 5 text

Introduction ! ! !

Slide 6

Slide 6 text

Introduction Examples ! !

Slide 7

Slide 7 text

Introduction Examples Deconstruction !

Slide 8

Slide 8 text

Introduction Examples Deconstruction Collection Views

Slide 9

Slide 9 text

! Examples Deconstruction Collection Views Limitations & Gotchas Introduction

Slide 10

Slide 10 text

Introduction

Slide 11

Slide 11 text

Introduced with iOS 7 Not a separate framework – built into UIKit Can be anywhere you're using UIKit

Slide 12

Slide 12 text

Another tool in your tool belt

Slide 13

Slide 13 text

Physics-Based Interfaces

Slide 14

Slide 14 text

Classical Mechanics

Slide 15

Slide 15 text

Classical mechanics is concerned with the set of physical laws describing the motion of bodies under the action of a system of forces.

Slide 16

Slide 16 text

2014

Slide 17

Slide 17 text

2014 2007

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

2014 2007

Slide 23

Slide 23 text

2014 2007 1972

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Pong: the original physics-based interface.

Slide 26

Slide 26 text

More Recent Examples

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

UIKit Dynamics

Slide 40

Slide 40 text

Natural, real-world interactions Without very much code Beautiful API Fun Knowledge of physics not required

Slide 41

Slide 41 text

UIView

Slide 42

Slide 42 text

UIView UIDynamicAnimator Reference View

Slide 43

Slide 43 text

UIView UIDynamicAnimator Reference View UIGravityBehavior

Slide 44

Slide 44 text

UIView UIDynamicAnimator Reference View UIGravityBehavior UICollisionBehavior

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

UIDynamicItem Protocol !

Slide 47

Slide 47 text

UIDynamicItem Protocol UIView UICollectionViewLayoutAttributes

Slide 48

Slide 48 text

UIDynamicBehaviors

Slide 49

Slide 49 text

UIDynamicBehavior Base Class

Slide 50

Slide 50 text

UICollisionBehavior UIGravityBehavior ! ! !

Slide 51

Slide 51 text

UICollisionBehavior UIGravityBehavior UIAttachmentBehavior UIDynamicItemBehavior UIPushBehavior UISnapBehavior

Slide 52

Slide 52 text

Demo

Slide 53

Slide 53 text

Deconstruction

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

UICollisionBehavior UIGravityBehavior UIAttachmentBehavior UIDynamicItemBehavior UIPushBehavior UISnapBehavior

Slide 57

Slide 57 text

1. Create a UIDynamicAnimator. 2. Recognize a touch, and add an attachment behavior. 3. Update the attachment’s anchor point during the gesture. 4. When the gesture ends, add a snap behavior or a push behavior.

Slide 58

Slide 58 text

1. Create a UIDynamicAnimator. 2. Recognize a touch, and add an attachment behavior. 3. Update the attachment’s anchor point during the gesture. 4. When the gesture ends, add a snap behavior or a push behavior.

Slide 59

Slide 59 text

1. Create a UIDynamicAnimator. 2. Recognize a touch, and add an attachment behavior. 3. Update the attachment’s anchor point during the gesture. 4. When the gesture ends, add a snap behavior or a push behavior.

Slide 60

Slide 60 text

1. Create a UIDynamicAnimator. 2. Recognize a touch, and add an attachment behavior. 3. Update the attachment’s anchor point during the gesture. 4. When the gesture ends, add a snap behavior or a push behavior.

Slide 61

Slide 61 text

Demo

Slide 62

Slide 62 text

Collection Views

Slide 63

Slide 63 text

Gotchas

Slide 64

Slide 64 text

Only 2D Hard to visualize Weird units Everything’s a square Not perfect for games

Slide 65

Slide 65 text

Recap

Slide 66

Slide 66 text

Introduced UIKit Dynamics PhotoFling Demo TweetBattle Demo Limitations & Gotchas

Slide 67

Slide 67 text

Thanks!

Slide 68

Slide 68 text

Discussion https://github.com/livefront/dynamics Adam May @yammada ! Sam Kirchmeier @skirchmeier