Improving performance for UICollectionView in i...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Improving performance for UICollectionView in iOS10

Slides of my talk at the DO-iOS 2016 conference including optimise drawing processing.

Bart den Hollander

November 15, 2016

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

48 slides
  1. !

  2. "#

  3. Cell pre-fetching func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) func

    collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) New in iOS10
  4. Cell pre-fetching class MinionsViewController: UICollectionViewController { override func viewDidLoad() {

    super.viewDidLoad() collectionView.prefetchDataSource = self } } extension MinionsViewController: UICollectionViewDataSourcePrefetching { func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) { ImagePreloader.preloadImagesForIndexPath(indexPaths) } func collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) { ImagePreloader.cancelPreloadImagesForIndexPath(indexPaths) } } New in iOS10
  5. class MinionsViewController: UICollectionViewController { override func viewDidLoad() { super.viewDidLoad() }

    extension MinionsViewController: UICollectionViewDataSourcePrefetching { func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) { ImagePreloader.preloadImagesForIndexPath(indexPaths) } func collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) { ImagePreloader.cancelPreloadImagesForIndexPath(indexPaths) } } Cell pre-fetching collectionView.prefetchDataSource = self } New in iOS10
  6. class MinionsViewController: UICollectionViewController { override func viewDidLoad() { super.viewDidLoad() collectionView.prefetchDataSource

    = self } } func collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) { ImagePreloader.cancelPreloadImagesForIndexPath(indexPaths) } } Cell pre-fetching extension MinionsViewController: UICollectionViewDataSourcePrefetching { func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) { ImagePreloader.preloadImagesForIndexPath(indexPaths) } New in iOS10
  7. func collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) { ImagePreloader.cancelPreloadImagesForIndexPath(indexPaths) }

    class MinionsViewController: UICollectionViewController { override func viewDidLoad() { super.viewDidLoad() collectionView.prefetchDataSource = self } } extension MinionsViewController: UICollectionViewDataSourcePrefetching { func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) { ImagePreloader.preloadImagesForIndexPath(indexPaths) } } Cell pre-fetching New in iOS10

Other Decks in Technology