Slide 1

Slide 1 text

A library for saving children @yashigani Cocoa Studying Kansai #53

Slide 2

Slide 2 text

@yashigani

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Texting while walking is danger for children!

Slide 8

Slide 8 text

Stop-Walking-iPhone

Slide 9

Slide 9 text

Stop-Walking-iPhone • It is a library that showing warning on app when texting while walking with iPhone • Powered by M7 • https://github.com/yashigani/Stop-Walking-iPhone

Slide 10

Slide 10 text

Core Concept • Easy to use (for developer) • Not annoying • Fun

Slide 11

Slide 11 text

Easy to use • Install by CocoaPods • Include default settings, default pictures • Of course can use original setting or resources • Should add one line code to enable

Slide 12

Slide 12 text

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [SWIManager.sharedManager start]; return YES; }

Slide 13

Slide 13 text

Not annoying • Overlay on App • No buttons • Big picture

Slide 14

Slide 14 text

Fun • Rich interface • Physical interaction • Like a Tweetbot 3 • Suppress bad impression • Pretty icons • Demo

Slide 15

Slide 15 text

6 types pictures

Slide 16

Slide 16 text

iOS 7 Design Standard • By Hiroaki Ogino (Chief Designer at Fenrir Inc.) • Flat design on iOS 7 • UI/UX • Not only designer. For anyone engage in iOS • Buy now!

Slide 17

Slide 17 text

Implementation • M7 • CMMotionActivity • UIKit Dynamics • Hook animations

Slide 18

Slide 18 text

M7 • CMStepCounter • CMMotionActivityMana ger • CMMotionActivity • Privacy • Settings -> Privacy -> Motion Activity

Slide 19

Slide 19 text

CMMotionActivityManager __weak __typeof(self) wself = self; CMMotionActivityManager *manager = [CMMotionActivityManager new]; NSOperationQueue *queue = NSOperationQueue.mainQueue; [manager startActivityUpdatesToQueue:queue withHandler:^(CMMotionActivity *activity) { [wself handleActivity:activity]; }];

Slide 20

Slide 20 text

CMMotionActivity • Container motion data • Type of motion • stationary/walking/running/automotive • Metadata for motion • startDate • confidence

Slide 21

Slide 21 text

Can access historical data • M7 always storing Activity on your device • Can get historical data • queryStepCountStartingFrom:to:toQueue:withHand ler: • queryActivityStartingFromDate:toDate:toQueue:wit hHandler: • Apps using M7 shouldn’t need move background

Slide 22

Slide 22 text

UIKit Dynamics • Real-world inspired animation and interaction • Easy to use • Improve quality on custom UI parts with animation • Demo

Slide 23

Slide 23 text

Hook animations • Can’t hook animation state • Not enough UIDynamicAnimatorDelegate • Use UICollisionBehaviorDelegate • Don’t calculate speed and duration

Slide 24

Slide 24 text

UICollisionBehavior • One of predefined behavior • Easy to understand • Boundary • Can create bigger than reference view • Path • NSBezierPath

Slide 25

Slide 25 text

Hook animation by collision • Create boundary bigger than screen • Disappear view when handled become collision

Slide 26

Slide 26 text

Conclusion • Don’t texting while walking • M7 and CMMotionActivityManager • Hook animations on UIKit Dynamics • Include Stop-Walking-iPhone your App :)

Slide 27

Slide 27 text

One more thing…

Slide 28

Slide 28 text

YSViewer • Image viewer library like Tweetbot 3 • https://github.com/ yashigani/YSViewer • Install by CocoaPods • Free to use • Today

Slide 29

Slide 29 text

Thank you!

Slide 30

Slide 30 text

Credits • Jonathan Adami: http://www.flickr.com/photos/ jonathanadami/7953963856/ • Charles LeBlanc: http://www.flickr.com/photos/ httpoldmaisonblogspotcom/7070786787/ • Robert Couse-Baker: http://www.flickr.com/photos/ 29233640@N07/5535961307/ • jan zuppinger: http://www.flickr.com/photos/ pieceoplastic/8293895852/ • Wang Alive: http://www.flickr.com/photos/wang_alive/ 8044415103/