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
-
Add the following line to your Podfile:
pod 'TableRow'
-
Run
$ pod install
Carthage
-
Add the following line to your Cartfile:
github "EurekaCommunity/TableRow"
-
Run
$ carthage update
-
Link
TableRow.framework
in your target, add it toinput files
list in Build PhasesCopy Frameworks
script
Customization
TableRow
textColor
- provide default text color for underlying tableView cellshorizontalContentInset
- provide content inset for cells to distinguish from other rowsconfigureCell
callback - configure internal cell during cell dequeueingonDidSelect
callback - called every time internal cell selected
TableInlineRow
subcellTextColor, subcellHorizontalInset
- provide corresponding parameters for TableRowconfigureSubcell
callback - setconfigureCell
callback fro TableRowonToggleInlineRow
callback - optionally provide action depending on row toggled state