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

Pitfalls of PhotoKit

Pitfalls of PhotoKit

関西モバイルアプリ研究会 #9 (kanmoba)

griffin-stewie

December 22, 2015
Tweet

More Decks by griffin-stewie

Other Decks in Programming

Transcript

  1. Pitfalls of PhotoKit
    @griffin_stewie

    View Slide

  2. Fenrir Inc.
    @griffin_stewie
    Bouldering: Level 5

    View Slide

  3. PhotoKit

    View Slide

  4. PhotoKit
    • From iOS 8
    • Sophisticated
    • Thread safe

    View Slide

  5. Simple Fetching

    View Slide

  6. Assets Library
    • Enumerate groups and assets
    • Filter inside loop
    • Easy access raw data

    View Slide

  7. PhotoKit
    • Call fetch methods
    • Like CoreData
    • Apply fetch options

    View Slide

  8. Complicated Fetching

    View Slide

  9. PHFetchOptions
    • dates
    • pixelWidth
    • pixelHeight
    • etc

    View Slide

  10. PhotoKit
    • Access raw data ?

    View Slide

  11. Darkside

    View Slide

  12. Too slow

    View Slide

  13. Fetching 5000 assets
    • Assets Library
    • Takes a few seconds
    • PhotoKit
    • Takes a few minutes

    View Slide

  14. Reasons

    View Slide

  15. XPC
    • Assets Library
    • Same process as app
    • PhotoKit
    • Separate process
    • Communicate using XPC

    View Slide

  16. Thread safe
    • Assets Library
    • Developers should take care of it
    • PhotoKit
    • Framework cares

    View Slide

  17. Let's use obediently

    View Slide