Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Floussov nickfl

View GitHub Profile
@OscarApeland
OscarApeland / Nibable.md
Last active Sep 22, 2018
Swift 4 - Nibable
View Nibable.md

Introduction

UIKits API for registering UINibs to UICollectionViews looks bad. Just look at this.

sizeCollectionView.register(UINib(nibName: "SearchFilterSizeCell", bundle: nil), forCellWithReuseIdentifier: "sizeCell")

Using them again is even worse;

let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "sizeCell", for: indexPath) as! SearchFilterSizeCell