Slide 1

Slide 1 text

iOS 9 Bootcamp

Slide 2

Slide 2 text

#cm_ios9 #eventdots

Slide 3

Slide 3 text

https://github.com/kishikawakatsumi/ kishikawa katsumi http://kishikawakatsumi.com/ @ Realm

Slide 4

Slide 4 text

Agenda • What’s new in StoryBoard & AutoLayout - UIStackView - StoryBoard Reference • Spotlight API

Slide 5

Slide 5 text

What’s new in StoryBoard & AutoLayout

Slide 6

Slide 6 text

UIStackView

Slide 7

Slide 7 text

UIStackView w Ϥί·ͨ͸λςҰྻʹෳ਺ͷαϒϏϡʔΛϨ ΠΞ΢τͯ͘͠ΕΔϏϡʔ w εϖʔε΍ఱ஍ʢલޙʣͷدͤΛௐ੔Մೳ

Slide 8

Slide 8 text

UITableView, UICollectionView + UIStackView?

Slide 9

Slide 9 text

UITableView, UICollectionView + UIStackView?

Slide 10

Slide 10 text

UIStackView is a wrapper of AutoLayout by Apple

Slide 11

Slide 11 text

AutoLayout Constraints

Slide 12

Slide 12 text

AutoLayout Constraints

Slide 13

Slide 13 text

AutoLayoutͷ໰୊ w ࠩ෼͕֬ೝͮ͠Β͍ ίʔυϨϏϡʔͮ͠Β͍ w ଞਓ͕ϝϯςφϯεͰ͖ͳ͍ 6*ͷ໰୊͕େ͖͍ w Ϗϡʔಉ࢜Ͱ੍͔͠໿͕͚ͭΒΕͳ͍ ϏϡʔΛ࡟আͨ࣌͠ʹ෇͚ସ͑Δඞཁ͕͋Δ μϛʔ7JFXͳͲ8PSLBSPVOEͷ૿Ճ

Slide 14

Slide 14 text

UIStackView

Slide 15

Slide 15 text

Refactor with UIStackView

Slide 16

Slide 16 text

Refactor with UIStackView

Slide 17

Slide 17 text

Refactor with UIStackView

Slide 18

Slide 18 text

Refactor with UIStackView

Slide 19

Slide 19 text

DEMO

Slide 20

Slide 20 text

AutoLayout Constraints

Slide 21

Slide 21 text

Start with Stack View, use constraints as needed WWDC 2015 218 Misteries of AutoLayout part 1

Slide 22

Slide 22 text

Wrap up w 6*4UBDL7JFX͸"QQMFʹΑΔ"VUP-BZPVUͷϥούʔ w "VUP-BZPVU͕γϯϓϧʹͳΔ w ϏϡʔͷIJEEFOϓϩύςΟΛࣗಈతʹରԠ 8PSLBSPVOE͕͔ͳΓݮΒͤΔʢ͸ͣʣ w ࠩ෼͕֬ೝͮ͠Β͍໰୊ɺίʔυϨϏϡʔͮ͠Β͍໰୊ͳͲ ͸࢒Δ w J04POMZ

Slide 23

Slide 23 text

References • 218 Mysteries of Auto Layout, Part 1- WWDC 2015 • UIStackView Tutorial: Introducing Stack Views - raywenderlich.com • Playing With UIStackView - swiftandpainless.com/playing-with-uistackview/ • OAStackView - github.com/oarrabi/OAStackView

Slide 24

Slide 24 text

StoryBoard Reference

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Refactor to Storyboard

Slide 28

Slide 28 text

Refactor to Storyboard

Slide 29

Slide 29 text

Refactor to Storyboard

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

Wrap up w࢖͍উख͸ͦͷ··ʹ4UPSZCPBSEΛ෼ׂͰ͖Δ w 9DPEFͷαϙʔτ͋Γ w$BOEFQMPZJ04EFWJDFTXJUIMJNJUBUJPOT 9DPEFͷϦϦʔεϊʔτʹ੍ݶͷهड़͕͋Δ ੍ݶΞϦͱͷهड़͕ͩ4FHVFͳͲਖ਼͘͠ػೳ͍ͯ͠Δ Α͏ʹݟ͑Δ

Slide 32

Slide 32 text

Spotlight API

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Search APIs • NSUserActivity • CoreSpotlight • Web Markup

Slide 35

Slide 35 text

Search APIs • NSUserActivity • CoreSpotlight • Web Markup

Slide 36

Slide 36 text

CSSearchableItemAttributeSet *attributeSet = [[CSSearchableItemAttributeSet alloc] initWithItemContentType:…]; attributeSet.title = program.title; attributeSet.contentDescription = [NSString stringWithFormat:@"%@ %@\n%@", ...]; attributeSet.startDate = program.startDate; attributeSet.endDate = program.endDate; CSSearchableItem *item = [[CSSearchableItem alloc] initWithUniqueIdentifier:program.identifier domainIdentifier:@“programs" attributeSet:attributeSet]; [searchableItems addObject:item]; CSSearchableIndex *searchableIndex = [CSSearchableIndex defaultSearchableIndex]; [searchableIndex indexSearchableItems:@[searchableItem] completionHandler:...] ݕࡧΠϯσοΫεʹ௥Ճɾߋ৽

Slide 37

Slide 37 text

[searchableIndex deleteSearchableItemsWithIdentifiers:@[identifier] completionHandler:...]; [searchableIndex deleteSearchableItemsWithDomains:@[domain] completionHandler:...]; [searchableIndex deleteAllSearchableItemsWithCompletionHandler:...]; ݕࡧΠϯσοΫε͔Β࡟আ

Slide 38

Slide 38 text

Example: Book app

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Challenges • How to track contents changed • Can users choose index or not per contents?

Slide 41

Slide 41 text

Example: TV programs app

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Challenges • How long to keep index the contents? • Can users remove from index?

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Wrap up • ΞϓϦΛԣஅͯ͠ݕࡧͰ͖Δ • άϩʔόϧͳ৘ใΛݕࡧՄೳʹ͢ΔͱΑ͍ʁ • ϓϩάϥϜ͔Βݕࡧ͢ΔAPI͸ͳ͍ʢ௥Ճɾߋ ৽ɾ࡟আͷΈʣ • ݕࡧ݁ՌΛΩϨΠʹอͭ޻෉͕ඞཁ

Slide 46

Slide 46 text

Wrap up • UIStackView • StoryBoard Reference • Spotlight API