Upgrade to Pro — share decks privately, control downloads, hide ads and more …

UIStackView, Storyboard Reference, CoreSpotlight API - iOS 9 bootcamp

UIStackView, Storyboard Reference, CoreSpotlight API - iOS 9 bootcamp

9bf923e39671cde83584e3e926296c13?s=128

Kishikawa Katsumi

October 01, 2015
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Programming

Transcript

  1. iOS 9 Bootcamp

  2. #cm_ios9 #eventdots

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

  4. Agenda • What’s new in StoryBoard & AutoLayout - UIStackView

    - StoryBoard Reference • Spotlight API
  5. What’s new in StoryBoard & AutoLayout

  6. UIStackView

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

  8. UITableView, UICollectionView + UIStackView?

  9. UITableView, UICollectionView + UIStackView?

  10. UIStackView is a wrapper of AutoLayout by Apple

  11. AutoLayout Constraints

  12. AutoLayout Constraints

  13. AutoLayoutͷ໰୊ w ࠩ෼͕֬ೝͮ͠Β͍  ίʔυϨϏϡʔͮ͠Β͍ w ଞਓ͕ϝϯςφϯεͰ͖ͳ͍  6*ͷ໰୊͕େ͖͍ w

    Ϗϡʔಉ࢜Ͱ੍͔͠໿͕͚ͭΒΕͳ͍  ϏϡʔΛ࡟আͨ࣌͠ʹ෇͚ସ͑Δඞཁ͕͋Δ  μϛʔ7JFXͳͲ8PSLBSPVOEͷ૿Ճ
  14. UIStackView

  15. Refactor with UIStackView

  16. Refactor with UIStackView

  17. Refactor with UIStackView

  18. Refactor with UIStackView

  19. DEMO

  20. AutoLayout Constraints

  21. Start with Stack View, use constraints as needed WWDC 2015

    218 Misteries of AutoLayout part 1
  22. Wrap up w 6*4UBDL7JFX͸"QQMFʹΑΔ"VUP-BZPVUͷϥούʔ w "VUP-BZPVU͕γϯϓϧʹͳΔ w ϏϡʔͷIJEEFOϓϩύςΟΛࣗಈతʹରԠ  8PSLBSPVOE͕͔ͳΓݮΒͤΔʢ͸ͣʣ

    w ࠩ෼͕֬ೝͮ͠Β͍໰୊ɺίʔυϨϏϡʔͮ͠Β͍໰୊ͳͲ ͸࢒Δ w J04POMZ
  23. 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
  24. StoryBoard Reference

  25. None
  26. None
  27. Refactor to Storyboard

  28. Refactor to Storyboard

  29. Refactor to Storyboard

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

  32. Spotlight API

  33. None
  34. Search APIs • NSUserActivity • CoreSpotlight • Web Markup

  35. Search APIs • NSUserActivity • CoreSpotlight • Web Markup

  36. 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:...] ݕࡧΠϯσοΫεʹ௥Ճɾߋ৽
  37. [searchableIndex deleteSearchableItemsWithIdentifiers:@[identifier] completionHandler:...]; [searchableIndex deleteSearchableItemsWithDomains:@[domain] completionHandler:...]; [searchableIndex deleteAllSearchableItemsWithCompletionHandler:...]; ݕࡧΠϯσοΫε͔Β࡟আ

  38. Example: Book app

  39. None
  40. Challenges • How to track contents changed • Can users

    choose index or not per contents?
  41. Example: TV programs app

  42. None
  43. Challenges • How long to keep index the contents? •

    Can users remove from index?
  44. None
  45. Wrap up • ΞϓϦΛԣஅͯ͠ݕࡧͰ͖Δ • άϩʔόϧͳ৘ใΛݕࡧՄೳʹ͢ΔͱΑ͍ʁ • ϓϩάϥϜ͔Βݕࡧ͢ΔAPI͸ͳ͍ʢ௥Ճɾߋ ৽ɾ࡟আͷΈʣ •

    ݕࡧ݁ՌΛΩϨΠʹอͭ޻෉͕ඞཁ
  46. Wrap up • UIStackView • StoryBoard Reference • Spotlight API