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

iOS10時代のCollectionView最新つかいこなし

Tachibana Kaoru
August 20, 2016
12k

 iOS10時代のCollectionView最新つかいこなし

Tachibana Kaoru

August 20, 2016
Tweet

Transcript

  1. Cell Lifecycle cell cell cell cell cell cell cell cell

    cell cell cell cell cell cell cell cell cell cell cell cell cell cell cell cell 10000 cells for 10000-row table?
  2. Cell Lifecycle cell cell cell cell cell cell cell cell

    cell cell cell cell cell cell cell cell cell cell cell cell cell cell cell cell 10000 cells for 10000-row table? x
  3. Cell Lifecycle 2 3 4 5 6 7 UICollectionViewCell -

    prepareForReuse ࠷ॳʹੜ੒͞ΕͨηϧΛ queueʹ͍Εͯ࠶ར༻
  4. Cell Lifecycle 2 3 4 5 6 7 ͜Ε͕ reuse

    Λ΋ͱʹͨ͠ CellͷLifecycleͰ͢ɻ
  5. Cell Lifecycle 2 3 4 5 6 8 7 9

    10 ࠓ·Ͱ͸ɺը໘ʹදࣔ͞ΕΔ௚લʹηϧ͕ੜ੒͞Εͯ ͍ͨͷͰɺͦͷॲཧ͕஗ΕΔͱεΫϩʔϧॲཧʹӨڹ ͕Ͱ͍ͯ·ͨ͠ queueͷCellͷ਺͕૿͑ͨ͜ͱͰੜ੒ॲཧ͕஗ΕΔ͜ͱ Մೳੑ͕௿͘ͳΓεΫϩʔϧͷύϑΥʔϚϯε͕Α͘ ͳΓ·ͨ͠
  6. Cell Lifecycle 2 3 4 5 6 8 7 9

    10 ͜͜ͰcellForItemAtIndexPath ͜͜ͰwillDisplay iOS10Ͱ͸……
  7. prefetch API func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) func

    collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath])