netspencer / TableRow

Custom row for Eureka library that allows selection between several options, built on embedded tableView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

TableRow and TableInlineRow are custom rows for Eureka form library. TableRow uses UITableView inside cell and allows to pick between multiple options. TableInlineRow is InlineRow on top of TableRow.

Usage

Rows are generic, so different cases are possible

import Eureka
import TableRow

class ViewController: FormViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        form +++ Section()
            <<< TableRow<Int> { row in
            	row.options = [1, 2, 3]
            	row.displayValueFor = { "\($0 ?? 0)" }
            }
            <<< TableInlineRow<String> { row in
                row.options = ["first", "second", "third"]
                row.value = "none"
            }
    }
}

Requirements

  • iOS 9.0+
  • Xcode 11.0+
  • Eureka 5.0+

Installation

CocoaPods

  1. Add the following line to your Podfile:

    pod 'TableRow'
  2. Run $ pod install

Carthage

  1. Add the following line to your Cartfile:

    github "EurekaCommunity/TableRow"
    
  2. Run $ carthage update

  3. Link TableRow.framework in your target, add it to input files list in Build Phases Copy Frameworks script

Customization

TableRow

  • textColor - provide default text color for underlying tableView cells
  • horizontalContentInset - provide content inset for cells to distinguish from other rows
  • configureCell callback - configure internal cell during cell dequeueing
  • onDidSelect callback - called every time internal cell selected

TableInlineRow

  • subcellTextColor, subcellHorizontalInset - provide corresponding parameters for TableRow
  • configureSubcell callback - set configureCell callback fro TableRow
  • onToggleInlineRow callback - optionally provide action depending on row toggled state

Author

About

Custom row for Eureka library that allows selection between several options, built on embedded tableView

License:MIT License


Languages

Language:Swift 91.5%Language:Ruby 4.7%Language:Objective-C 3.8%