All Projects → serhatsezer → TableViewExtension

serhatsezer / TableViewExtension

Licence: other
This extension simplify registering any cell, reusing and other verbosity steps.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to TableViewExtension

SNAdapter
iOS swift tableview and collectionView Adapter
Stars: ✭ 35 (+169.23%)
Mutual labels:  generic, tableview, tableviewcell
android-tableview-kotlin
Android's missing TableView component.
Stars: ✭ 40 (+207.69%)
Mutual labels:  tableview, tableviewcell
ReactiveDataDisplayManager
No description or website provided.
Stars: ✭ 35 (+169.23%)
Mutual labels:  tableview, tableviewcell
ZXTableView
快速、高效地构建TableView,节省80%以上重复代码,无需设置数据源和代理。
Stars: ✭ 18 (+38.46%)
Mutual labels:  tableview, tableviewcell
Tdbadgedcell
TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps
Stars: ✭ 1,444 (+11007.69%)
Mutual labels:  tableview, tableviewcell
generic
Generic programming library for Python
Stars: ✭ 50 (+284.62%)
Mutual labels:  generic, generic-programming
GenericRecyclerAdapter
Easiest way to use RecyclerView. Reduce boilerplate code! You don't need to write adapters for listing pages anymore!
Stars: ✭ 53 (+307.69%)
Mutual labels:  generic, generic-programming
SPPickerView
这是一个选择器,功能类似系统的UIPickerView,但是比UIPickerView的适用范围广得多
Stars: ✭ 28 (+115.38%)
Mutual labels:  tableview
RangeTree
A generic interval tree implementation in C#
Stars: ✭ 144 (+1007.69%)
Mutual labels:  generic
DLStretchableTableHeaderView
TableView with strechable header
Stars: ✭ 17 (+30.77%)
Mutual labels:  tableview
ContentTableViewController
🏓 Super simple CocoaPod to present content. https://insanj.github.io/ContentTableViewController/
Stars: ✭ 24 (+84.62%)
Mutual labels:  tableview
bppgrid
QtQuick 2 Table component, modeled on TableView QML Type and some other Cool qml components
Stars: ✭ 54 (+315.38%)
Mutual labels:  tableview
Processor
Ontology-driven Linked Data processor and server for SPARQL backends. Apache License.
Stars: ✭ 54 (+315.38%)
Mutual labels:  generic
pressio
Model reduction for linear and nonlinear dynamical systems: core C++ library
Stars: ✭ 35 (+169.23%)
Mutual labels:  generic-programming
omnipersistence
Utilities for JPA, JDBC and DataSources
Stars: ✭ 24 (+84.62%)
Mutual labels:  generic
SectionReactor
A ReactorKit extension for managing table view and collection view sections with RxDataSources
Stars: ✭ 45 (+246.15%)
Mutual labels:  tableview
MultilevelList
TableView多级列表:分级展开或合并,逐级获取并展示其子级数据,可以设置最大的层级数,支持多选、单选、取消选择。
Stars: ✭ 59 (+353.85%)
Mutual labels:  tableview
dart sealed
Dart and Flutter sealed class generator and annotations, with match methods and other utilities. There is also super_enum compatible API.
Stars: ✭ 16 (+23.08%)
Mutual labels:  generic
react-native-card-button
Fully customizable Card Button via Paraboly for React Native.
Stars: ✭ 16 (+23.08%)
Mutual labels:  generic
GenericTensor
The only library allowing to create Tensors (matrices extension) with custom types
Stars: ✭ 42 (+223.08%)
Mutual labels:  generic

TableViewExtension

When we are working with UITableView with code or Nibs we always have to write lots of code for to tableview do its job. This extension helps you write more swifty way to do so.

Usage

You can register a UITableViewCell, HeaderFooterView as simple as like;

tableView.reuse(CustomTableViewCell.self, fromNib: true) // fromNib is a optional. Default value is false.

You can use this method to dequeue your cell or header view;

tableView.dequeue(indexPath, fromNib: true)

Here is full the implementation

class ViewController: UIViewController {

    @IBOutlet weak var tableView: UITableView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        tableView
            .reuse(InfoCell.self) // Without nib file
            .reuse(CustomTableViewCell.self, fromNib: true) // With nib file
            .registerHeaderFooter(HeaderView.self, fromNib: true)
    }
}

extension ViewController: UITableViewDelegate, UITableViewDataSource {
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        if indexPath.row % 2 == 0 {
            let infoCell: InfoCell = tableView.dequeue(indexPath)
            return infoCell
        } else {
            let secondCell: SecondTableViewCell = tableView.dequeue(indexPath, fromNib: true)
            return secondCell
        }
    }
    
    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 2
    }
    
    func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        let sectionHeaderView: HeaderView? = tableView.dequeueHeaderFooter(fromNib: true)
        
        return sectionHeaderView
    }
}
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].