Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgellci/quicktable
A quicker way to build UITableViews
https://github.com/kgellci/quicktable
swift uitableview
Last synced: 3 days ago
JSON representation
A quicker way to build UITableViews
- Host: GitHub
- URL: https://github.com/kgellci/quicktable
- Owner: kgellci
- License: mit
- Created: 2017-05-12T06:24:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-14T05:09:10.000Z (over 7 years ago)
- Last Synced: 2024-12-09T18:41:17.516Z (25 days ago)
- Topics: swift, uitableview
- Language: Swift
- Size: 163 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QuickTable
[![CI Status](http://img.shields.io/travis/kgellci/QuickTable.svg?style=flat)](https://travis-ci.org/kgellci/QuickTable)
[![Version](https://img.shields.io/cocoapods/v/QuickTable.svg?style=flat)](http://cocoapods.org/pods/QuickTable)
[![License](https://img.shields.io/cocoapods/l/QuickTable.svg?style=flat)](http://cocoapods.org/pods/QuickTable)
[![Platform](https://img.shields.io/cocoapods/p/QuickTable.svg?style=flat)](http://cocoapods.org/pods/QuickTable)
![Swift 3.1](https://img.shields.io/badge/Swift-3.0-orange.svg)## Warning
Currently developing to a stable version. Use as an experiment for now.
## Usage
QuickTable is a subclass of UITableView, you can set it up via interface builder or in code. No need to worry about UItableViewDelegate and DataSource!
```swift
let tableView = QuickTable()
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "MyTableViewCell")
```Create a row you want to display, add it to a section and set the section to the QuickTable
```swift
let row = QuickRow(reuseIdentifier: "MyTableViewCell", styleBlock: { (cell) in
cell.textLabel?.text = "Hello World!"
})let section = QuickSection(quickRowModels: [row])
```You can style the section by passing options
```swift
let secondSection = QuickSection(options: [.headerTitle("The Header"), .footerTitle("The Footer")])
```Tapping on a row is handled via a block
```swift
row.selectionBlock = { (cell) -> Bool in
// The row was selected do something!// return if the cell should auto deselect
return true
}
```You can use automatic height computation or define the height on a section or row level
```swift
section.rowHeight = 60// OR
row.computeRowHeightBlock { (row) -> CGFloat in
return 100
}```
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
Swift 3.1
## Installation
QuickTable is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "QuickTable"
```## Author
Kris Gellci [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://www.twitter.com/kgellci)
## License
QuickTable is available under the MIT license. See the LICENSE file for more info.