All Projects → mergesort → GenericCells

mergesort / GenericCells

Licence: MIT license
Creating generic UITableViewCells and UICollectionViewCells instead of subclasses.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to GenericCells

Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+2023.46%)
Mutual labels:  uitableview, uicollectionview
TinyCoordinator
The Swift version of ThinningCoordinator focus on lighter view controllers.
Stars: ✭ 18 (-77.78%)
Mutual labels:  uitableview, uicollectionview
Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (+102.47%)
Mutual labels:  uitableview, uicollectionview
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+13238.27%)
Mutual labels:  uitableview, uicollectionview
IQListKit
Model driven UITableView/UICollectionView
Stars: ✭ 51 (-37.04%)
Mutual labels:  uitableview, uicollectionview
Gskstretchyheaderview
A generic stretchy header for UITableView and UICollectionView
Stars: ✭ 1,624 (+1904.94%)
Mutual labels:  uitableview, uicollectionview
Rglistkit
RGListKit is a Protocol & MVVM based framework to easily populate a UITableView or UICollectionView via single api.
Stars: ✭ 178 (+119.75%)
Mutual labels:  uitableview, uicollectionview
Tangramkit
TangramKit is a powerful iOS UI framework implemented by Swift. It integrates the functions with Android layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView
Stars: ✭ 984 (+1114.81%)
Mutual labels:  uitableview, uicollectionview
Squaremosaiclayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations 🔶
Stars: ✭ 243 (+200%)
Mutual labels:  uitableview, uicollectionview
Tabanimated
A skeleton screen framework based on native for iOS. (一个由iOS原生组件映射出骨架屏的框架,包含快速植入,低耦合,兼容复杂视图等特点,提供国内主流骨架屏动画的加载方案,同时支持上拉加载更多、自定制动画。)
Stars: ✭ 2,909 (+3491.36%)
Mutual labels:  uitableview, uicollectionview
Basecomponents
BaseComponents aims to provide easily reusable and understandable components to increase productivity with UIKit and Foundation APIs
Stars: ✭ 92 (+13.58%)
Mutual labels:  uitableview, uicollectionview
HDEmptyView
一个Swift语言封装的EmptyView显示库,可作用于WKWebView、UITableView、UICollectionView 无网络提醒或者空数据提醒
Stars: ✭ 29 (-64.2%)
Mutual labels:  uitableview, uicollectionview
Carbon
🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView.
Stars: ✭ 1,034 (+1176.54%)
Mutual labels:  uitableview, uicollectionview
Genericdatasource
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.
Stars: ✭ 127 (+56.79%)
Mutual labels:  uitableview, uicollectionview
Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (+1171.6%)
Mutual labels:  uitableview, uicollectionview
Hgplaceholders
Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project
Stars: ✭ 2,048 (+2428.4%)
Mutual labels:  uitableview, uicollectionview
Changeset
Minimal edits from one collection to another
Stars: ✭ 807 (+896.3%)
Mutual labels:  uitableview, uicollectionview
Thinningcoordinator
The UITableView/UICollectionView dataSource/delegate thinning coordinator, help thinning your UIViewController!
Stars: ✭ 25 (-69.14%)
Mutual labels:  uitableview, uicollectionview
Flowkit
A declarative type-safe framework for building fast and flexible list with Tables & Collection
Stars: ✭ 215 (+165.43%)
Mutual labels:  uitableview, uicollectionview
Cyanic
Declarative, state-driven UI framework
Stars: ✭ 32 (-60.49%)
Mutual labels:  uitableview, uicollectionview

GenericCells

Creating UITableViewCell and UICollectionViewCell subclasses is so Swift 2 point zero.

Pod Version Swift Version License MIT Plaform


Introducing, GenericCells!… Capitalizing on Swift's generics, we can get all the benefits of a custom UITableViewCell or UICollectionViewCell class, without the hassle of a new class for each of them.


Let's show you how to use it.

Create a UIView subclass for the layout you want:

final class MyView: UIView {

    let imageView: UIImageView
    let titleLabel: UILabel
    let subtitleLabel: UILabel
    // And add more views to your heart's content

}

Register the cell with a UITableView or UICollectionView:

tableView.register(GenericTableCell<MyView>.self)
collectionView.register(GenericCollectionCell<MyView>.self)

Dequeue the cell with a UITableView or UICollectionView:

let cell = tableView.dequeueReusableCell(forIndexPath: indexPath) as GenericTableCell<MyView>
let cell = collectionView.dequeueReusableCell(forIndexPath: indexPath) as GenericCollectionCell<MyView>

And customize it to your heart's content. The view you wish to access will be available via the .customView property:

cell.customView.titleLabel.text = "This library rules!"
cell.customView.imageView.image = UIImage(named: "success")

Extra credit, let's add recycling support. Extend your view with the ReusableGenericView protocol:

extension MyView: ReusableGenericView {

    func prepareForReuse() {
        self.titleLabel.text = ""
        self.subtitleLabel.text = ""
        self.imageView.image = nil
    }

}

And it will get called when the cell is recycled.

Installation

You can use SPM to install GenericCells.

You can also use CocoaPods to install GenericCells by adding it to your Podfile:

platform :ios, '9.0'
use_frameworks!

pod 'GenericCells'

Or install it manually by downloading GenericTableCell.swift, GenericCollectionCell.swift, and ReusableView.swift, and dropping it in your project.

About me

Hi, I'm Joe everywhere on the web, but especially on Twitter.

License

See the license for more information about how you can use GenericCells.

Is that it?

Yes, that's it. And if you don't like it, well sorry, here's a rainbow. 🌈

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].