tvOSのリスト系のインデックスラベルを自作してみる

E2c86baa99178b8400a2ef49ef861a6c?s=47 toshi0383
November 20, 2017

 tvOSのリスト系のインデックスラベルを自作してみる

Swift愛好会 vol24での発表資料です。
https://love-swift.connpass.com/event/67581

E2c86baa99178b8400a2ef49ef861a6c?s=128

toshi0383

November 20, 2017
Tweet

Transcript

  1. tvOSͷϦετܥͷΠϯ σοΫεϥϕϧΛࣗ࡞ͯ͠ ΈΔ Swi!Ѫ޷ձ vol24 Nov 20, 2017 Toshihiro Suzuki

    © Toshihiro Suzuki 2017 1
  2. whoami — ླ໦ ढ़༟ (@toshi0383) — ձࣾͰ͸ͱͬ͠ʔ͞Μ — iOS/tvOS dev

    at AbemaTV — GT SPORTS, F1 ! © Toshihiro Suzuki 2017 2
  3. Latest News © Toshihiro Suzuki 2017 3

  4. tools and apps © Toshihiro Suzuki 2017 4

  5. tvOSͷAccelerated Scrollʹ͍ͭͯ࿩͠·͢ © Toshihiro Suzuki 2017 5

  6. Accelerated Scroll (ߴ଎εΫϩʔϧ) tvOS10.2͔Β௥Ճ εΫϩʔϧ͕ॎʹ௕͍৔߹ʹɺ — ಉ͡ํ޲ʹԿ౓΋εϫΠϓ — λοναʔϑΣεӈ୺Λ্ԼʹεϫΠϓ ͷ͍ͣΕ͔ͰൃՐɻ

    ඪ४Ͱ༗ޮʹͳ͍ͬͯͯɺແޮʹ͸Ͱ͖ͳ͍ɻ © Toshihiro Suzuki 2017 6
  7. Accelerated Scroll © Toshihiro Suzuki 2017 7

  8. ϦετܥͷΠϯσοΫεϥϕϧ UITableView/UICollectionViewͰ͸ϥϕϧΛઃ ఆՄೳ delegateͰϥϕϧͱͦΕʹରԠ͢ΔIndexPath Λฦ͢ɻ © Toshihiro Suzuki 2017 8

  9. ϥϕϧʹରԠ͢Δ IndexPathʹҰؾʹδϟ ϯϓͰ͖ͯͱͯ΋ศར © Toshihiro Suzuki 2017 9

  10. ͦͷࠒAbemaTVͷ൪૊ද͸.. ೔෇ͷมߋͷͨΊʹ࠶ੜϘλϯΛ࢖Θ͍ͤͯ Δɻ © Toshihiro Suzuki 2017 10

  11. ՝୊ ຊདྷͰ͋Ε͹࠶ੜϘλϯ͸൪૊ද͔Βͷ௚઀࠶ ੜʹׂΓ౰͍ͯͨͱ͜Ζ ΠϯσοΫεϥϕϧʹ೔෇มߋͷػೳΛ೚ͤΕ ͹ɺ௚઀࠶ੜΛղ์Ͱ͖ͦ͏ɻ © Toshihiro Suzuki 2017 11

  12. ࣮ࡍʹdelegateΛ࣮૷͠ ͯΈͨ © Toshihiro Suzuki 2017 12

  13. © Toshihiro Suzuki 2017 13

  14. ໰୊ — ϑΥϯτ΍എܠ৭ɺදࣔҐஔΛࢦఆͰ͖ͳ͍ — ͔Ϳͬͯͱͯ΋ݟͮΒ͍ — ൒֯5จࣈ͘Β͍͕ݶ౓ͰɺͦΕҎ্ͩͱ truncate͞Εͨ ! ©

    Toshihiro Suzuki 2017 14
  15. Ͳ͏ͨ͠Β͍͍ͷ͔ © Toshihiro Suzuki 2017 15

  16. ղܾࡦͦͷ1: ඇදࣔʹ͢Δ ߴ଎εΫϩʔϧ͸ແޮʹͰ͖ͳ͍͕ɺΠϯσο ΫεΛඇදࣔʹ͢Δ͜ͱ͸Ͱ͖Δɻ if #available(tvOS 10.2, *) { collectionView.indexDisplayMode

    = .alwaysHidden } ΋ͪΖΜ൪૊දͷέʔεͰ͸͜Εͩͱ࠶ੜϘλ ϯׂΓ౰ͯ໰୊ͷղܾʹ͸ͳ͍ͬͯͳ͍ɻ © Toshihiro Suzuki 2017 16
  17. ղܾࡦͦͷ2: ࣗ࡞͢Δ — ӈ୺ͷεϫΠϓΛݕ஌͢Δ — ΠϯσοΫεΛεΫϩʔϧ͍ͯ͠Δؒ΋εϫ ΠϓʹεΫϩʔϧ͕൓Ԡ͢Δ — ӈ୺Λ্Լʹυϥοά͍ͯ͠Δؒ͸ɺεΫ ϩʔϧ͕Ճ଎ͯ͠Ұؾʹδϟϯϓ͢Δ

    — ΠϯσοΫεͷදࣔ/ඇදࣔ͸एׯlazyʹ൓Ԡ ͢Δ © Toshihiro Suzuki 2017 17
  18. ݁ߏྑ͘Ͱ͖ͯΔ ! © Toshihiro Suzuki 2017 18

  19. ͪΐͬͱ͚ͩؤுͬͯΈͨ © Toshihiro Suzuki 2017 19

  20. ࣮૷ ৄ͘͠͸ɺGitHubʹ্͛ͯ͋ΔαϯϓϧΛ͝ཡ ͍ͩ͘͞ɻ(ਵ࣌ߋ৽தɻɻ https://github.com/toshi0383/GestureTV © Toshihiro Suzuki 2017 20

  21. ӈ୺ͷ্ԼεϫΠϓͲ͏ ΍ͬͯऔಘ͢Δͷʁ © Toshihiro Suzuki 2017 21

  22. tvOS Advent CalendarͰެ։༧ఆʂ ॻ͍ͯ͘ΕΔਓ΋ืूத https://qiita.com/advent-calendar/2017/tvos © Toshihiro Suzuki 2017 22

  23. ·ͱΊ — tvOSͷϦετܥͷΠϯσοΫεϥϕϧΛࣗ࡞ ͯ͠Έ·ͨ͠ɻ — Πϕϯτ͑͞औΕΕ͹ɺ͋ͱ͸ͳΜͱ͔ͳΓ ͦ͏ɻ — ͜ΕͰগ͠͸൪૊ද͕࢖͍΍͘͢ͳΔ..ʁ —

    Advent CalendarΛ্ཱͪ͛ͳ͔ͬͨΒ͜͜ ·Ͱ΍͍ͬͯͳ͔͔ͬͨ΋ © Toshihiro Suzuki 2017 23
  24. We're hiring © Toshihiro Suzuki 2017 24