GenericReusable 0.2.1

GenericReusable 0.2.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2016
SPMSupports SPM

Maintained by Suyeol Jeon.



  • By
  • Suyeol Jeon

GenericReusable

Generic reusables for Cocoa. Currently supports UITableView and UICollectionView.

At a Glance

UITableView
struct Reusable {
    static let headerView = GenericCell<SectionHeaderView>()
    static let userCell = GenericCell<UserCell>()
}

tableView.registerView(Reusable.headerView)
tableView.registerCell(Reusable.userCell)

tableView.dequeueView(Reusable.userCell)
tableView.dequeueCell(Reusable.userCell)
UICollectionView
struct Reusable {
    static let headerView = GenericCell<SectionHeaderView>()
    static let photoCell = GenericCell<PhotoCell>()
}

collection.registerView(Reusable.headerView, kind: .Header)
collection.registerCell(Reusable.photoCell)

collection.dequeueView(Reusable.headerView, kind: .Header)
collection.dequeueCell(Reusable.photoCell, forIndexPath: indexPath)
Anything Else?

Pull requests are welcomed 💖

Installation

  • For iOS 8+ projects with CocoaPods:

    pod 'GenericReusable', '~> 0.2.0'
  • For iOS 8+ projects with Carthage:

    github "devxoul/GenericReusable" ~> 0.2.0
    
  • For iOS 7 projects with CocoaSeeds:

    github 'devxoul/GenericReusable', '0.2.0', :files => 'Sources/*.swift'

License

GenericReusable is under MIT license. See the LICENSE file for more info.