Instagram / IGListKit

A data-driven UICollectionView framework for building fast and flexible lists.
https://instagram.github.io/IGListKit/
MIT License
12.88k stars 1.54k forks source link

Swift Refinements #1387

Open koenpunt opened 4 years ago

koenpunt commented 4 years ago

Closing this as I've been experimenting w/ an all-swift rewrite that is a much better direction. Hoping we can open source this soon!

Originally posted by @rnystrom in https://github.com/Instagram/IGListKit/pull/1081#issuecomment-502477079

Given the fact that @rnystrom is no longer working at Instagram, I'm guessing the all-swift rewrite he was experimenting with is not going to be finished any time soon, right?

Would you accept a PR that adds Swift refinements to some of the APIs?

For example; the dequeueReusableCellOfClass:forSectionController:atIndex: could be refined in Swift to return a correctly typed cell;

func dequeueReusableCell<T: UICollectionViewCell>(
    of cellClass: T.Type, withReuseIdentifier reuseIdentifier: String,
    for sectionController: ListSectionController, at index: Int) -> T {
    return self.__dequeueReusableCell(
        of: cellClass, withReuseIdentifier: reuseIdentifier, 
        for: sectionController, at: index) as! T
}
iperry90 commented 4 years ago

Happy to take a look at PRs that add Swift refinements!