[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6701":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},6701,"Eureka","xmartlabs\u002FEureka","xmartlabs","Elegant iOS form builder in Swift","https:\u002F\u002Feurekacommunity.github.io",null,"Swift",11821,1311,247,164,0,6,69.95,"MIT License",false,"master",true,[24,25,26,27,28,29,30,31,32,33,34],"carthage","cocoapods","forms","hacktoberfest","ios","ios-forms","ios-ui","swift","swift-library","uitableview","validations","2026-06-12 04:00:30","![Eureka: Elegant form builder in Swift](Eureka.png)\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Ftravis-ci.org\u002Fxmartlabs\u002FEureka\">\u003Cimg src=\"https:\u002F\u002Ftravis-ci.org\u002Fxmartlabs\u002FEureka.svg?branch=master\" alt=\"Build status\" \u002F>\u003C\u002Fa>\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-iOS-blue.svg?style=flat\" alt=\"Platform iOS\" \u002F>\n\u003Ca href=\"https:\u002F\u002Fdeveloper.apple.com\u002Fswift\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fswift5-compatible-4BC51D.svg?style=flat\" alt=\"Swift 5 compatible\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage compatible\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fcocoapods.org\u002Fpods\u002FEureka\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FEureka.svg\" alt=\"CocoaPods compatible\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fxmartlabs\u002FEureka\u002Fmaster\u002FLICENSE\">\u003Cimg src=\"http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg?style=flat\" alt=\"License: MIT\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fcodebeat.co\u002Fprojects\u002Fgithub-com-xmartlabs-eureka\">\u003Cimg alt=\"codebeat badge\" src=\"https:\u002F\u002Fcodebeat.co\u002Fbadges\u002F16f29afb-f072-4633-9497-333c6eb71263\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\nMade with ❤️ by [XMARTLABS](http:\u002F\u002Fxmartlabs.com). This is the re-creation of [XLForm] in Swift.\n\n[简体中文](Documentation\u002FREADME_CN.md)\n\n## Overview\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Cth>\n      \u003Cimg src=\"Example\u002FMedia\u002FEurekaExample1.gif\" width=\"220\"\u002F>\n    \u003C\u002Fth>\n    \u003Cth>\n      \u003Cimg src=\"Example\u002FMedia\u002FEurekaExample2.gif\" width=\"220\"\u002F>\n    \u003C\u002Fth>\n    \u003Cth>\n    \u003Cimg src=\"Example\u002FMedia\u002FEurekaExample3.gif\" width=\"220\"\u002F>\n    \u003C\u002Fth>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Contents\n\n* [Requirements]\n* [Usage]\n  + [How to create a Form]\n  + [Getting row values]\n  + [Operators]\n  + [Using the callbacks]\n  + [Section Header and Footer]\n  + [Dynamically hide and show rows (or sections)]\n  + [List sections]\n  + [Multivalued sections]\n  + [Validations]\n  + [Swipe Actions]\n* [Custom rows]\n  + [Basic custom rows]\n  + [Custom inline rows]\n  + [Custom presenter rows]\n* [Row catalog]\n* [Installation]\n* [FAQ]\n\n**For more information look at [our blog post] that introduces *Eureka*.**\n\n## Requirements (for latest release)\n\n* Xcode 11+\n* Swift 5.0+\n\n### Example project\n\nYou can clone and run the Example project to see examples of most of Eureka's features.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Cth>\n      \u003Cimg src=\"Example\u002FMedia\u002FEurekaNavigation.gif\" width=\"200\"\u002F>\n    \u003C\u002Fth>\n    \u003Cth>\n      \u003Cimg src=\"Example\u002FMedia\u002FEurekaRows.gif\" width=\"200\"\u002F>\n    \u003C\u002Fth>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Usage\n\n### How to create a form\nBy extending `FormViewController` you can then simply add sections and rows to the `form` variable.\n\n```swift\nimport Eureka\n\nclass MyFormViewController: FormViewController {\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        form +++ Section(\"Section1\")\n            \u003C\u003C\u003C TextRow(){ row in\n                row.title = \"Text Row\"\n                row.placeholder = \"Enter text here\"\n            }\n            \u003C\u003C\u003C PhoneRow(){\n                $0.title = \"Phone Row\"\n                $0.placeholder = \"And numbers here\"\n            }\n        +++ Section(\"Section2\")\n            \u003C\u003C\u003C DateRow(){\n                $0.title = \"Date Row\"\n                $0.value = Date(timeIntervalSinceReferenceDate: 0)\n            }\n    }\n}\n```\n\nIn the example we create two sections with standard rows, the result is this:\n\n\u003Ccenter>\n\u003Cimg src=\"Example\u002FMedia\u002FEurekaHowTo.gif\" width=\"200\" alt=\"Screenshot of Custom Cells\"\u002F>\n\u003C\u002Fcenter>\n\nYou could create a form by just setting up the `form` property by yourself without extending from `FormViewController` but this method is typically more convenient.\n\n#### Configuring the keyboard navigation accesory\n\nTo change the behaviour of this you should set the navigation options of your controller. The `FormViewController` has a `navigationOptions` variable which is an enum and can have one or more of the following values:\n\n- **disabled**: no view at all\n- **enabled**: enable view at the bottom\n- **stopDisabledRow**: if the navigation should stop when the next row is disabled\n- **skipCanNotBecomeFirstResponderRow**: if the navigation should skip the rows that return false to `canBecomeFirstResponder()`\n\nThe default value is `enabled & skipCanNotBecomeFirstResponderRow`\n\nTo enable smooth scrolling to off-screen rows, enable it via the `animateScroll` property. By default, the `FormViewController` jumps immediately between rows when the user hits the next or previous buttons in the keyboard navigation accesory, including when the next row is off screen.\n\nTo set the amount of space between the keyboard and the highlighted row following a navigation event, set the `rowKeyboardSpacing` property. By default, when the form scrolls to an offscreen view no space will be left between the top of the keyboard and the bottom of the row.\n\n```swift\nclass MyFormViewController: FormViewController {\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        form = ...\n\n\t\u002F\u002F Enables the navigation accessory and stops navigation when a disabled row is encountered\n\tnavigationOptions = RowNavigationOptions.Enabled.union(.StopDisabledRow)\n\t\u002F\u002F Enables smooth scrolling on navigation to off-screen rows\n\tanimateScroll = true\n\t\u002F\u002F Leaves 20pt of space between the keyboard and the highlighted row after scrolling to an off screen row\n\trowKeyboardSpacing = 20\n    }\n}\n```\n\nIf you want to change the whole navigation accessory view, you will have to override the `navigationAccessoryView` variable in your subclass of `FormViewController`.\n\n\n### Getting row values\n\nThe `Row` object holds a  ***value*** of a specific type.\nFor example, a `SwitchRow` holds a `Bool` value, while a `TextRow` holds a `String` value.\n\n```swift\n\u002F\u002F Get the value of a single row\nlet row: TextRow? = form.rowBy(tag: \"MyRowTag\")\nlet value = row.value\n\n\u002F\u002F Get the value of all rows which have a Tag assigned\n\u002F\u002F The dictionary contains the 'rowTag':value pairs.\nlet valuesDictionary = form.values()\n```\n\n### Operators\n\nEureka includes custom operators to make form creation easy:\n\n#### +++ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add a section\n```swift\nform +++ Section()\n\n\u002F\u002F Chain it to add multiple Sections\nform +++ Section(\"First Section\") +++ Section(\"Another Section\")\n\n\u002F\u002F Or use it with rows and get a blank section for free\nform +++ TextRow()\n     +++ TextRow()  \u002F\u002F Each row will be on a separate section\n```\n\n#### \u003C\u003C\u003C &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Insert a row\n\n```swift\nform +++ Section()\n        \u003C\u003C\u003C TextRow()\n        \u003C\u003C\u003C DateRow()\n\n\u002F\u002F Or implicitly create the Section\nform +++ TextRow()\n        \u003C\u003C\u003C DateRow()\n```\n\n#### += &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Append an array\n\n```swift\n\u002F\u002F Append Sections into a Form\nform += [Section(\"A\"), Section(\"B\"), Section(\"C\")]\n\n\u002F\u002F Append Rows into a Section\nsection += [TextRow(), DateRow()]\n```\n\n### Result builders\n\nEureka includes result builders to make form creation easy:\n\n#### @SectionBuilder\n```swift\n\u002F\u002F Section + Section\nform = (Section(\"A\") +++ {\n    URLRow(\"UrlRow_f1\") { $0.title = \"Url\" }\n    if something {\n        TwitterRow(\"TwitterRow_f2\") { $0.title = \"Twitter\" }\n    } else {\n        TwitterRow(\"TwitterRow_f1\") { $0.title = \"Twitter\" }\n    }\n    AccountRow(\"AccountRow_f1\") { $0.title = \"Account\" }\n})\n\n\u002F\u002F Form + Section\nform +++ {\n    if something {\n        PhoneRow(\"PhoneRow_f1\") { $0.title = \"Phone\" }\n    } else {\n        PhoneRow(\"PhoneRow_f2\") { $0.title = \"Phone\" }\n    }\n    PasswordRow(\"PasswordRow_f1\") { $0.title = \"Password\" }\n}\n```\n\n#### @FormBuilder\n```swift\n@FormBuilder\nvar form: Form {\n    Section(\"Section A\") { section in\n        section.tag = \"Section_A\"\n    }\n    if true {\n        Section(\"Section B\") { section in\n            section.tag = \"Section_B\"\n        }\n    }\n    NameRow(\"NameRow_f1\") { $0.title = \"Name\" }\n}\n```\n\n### Using the callbacks\n\nEureka includes callbacks to change the appearance and behavior of a row.\n\n#### Understanding Row and Cell\n\nA `Row` is an abstraction Eureka uses which holds a **value** and contains the view `Cell`. The `Cell` manages the view and subclasses `UITableViewCell`.\n\nHere is an example:\n\n```swift\nlet row  = SwitchRow(\"SwitchRow\") { row in      \u002F\u002F initializer\n                        row.title = \"The title\"\n                    }.onChange { row in\n                        row.title = (row.value ?? false) ? \"The title expands when on\" : \"The title\"\n                        row.updateCell()\n                    }.cellSetup { cell, row in\n                        cell.backgroundColor = .lightGray\n                    }.cellUpdate { cell, row in\n                        cell.textLabel?.font = .italicSystemFont(ofSize: 18.0)\n                }\n```\n\n\u003Cimg src=\"Example\u002FMedia\u002FEurekaOnChange.gif\" width=\"300\" alt=\"Screenshot of Disabled Row\"\u002F>\n\n#### Callbacks list\n\n* **onChange()**\n\n\tCalled when the value of a row changes. You might be interested in adjusting some parameters here or even make some other rows appear or disappear.\n\n* **onCellSelection()**\n\n\tCalled each time the user taps on the row and it gets selected. Note that this will also get called for disabled rows so you should start your code inside this callback with something like `guard !row.isDisabled else { return }`\n\n* **cellSetup()**\n\n\tCalled only once when the cell is first configured. Set permanent settings here.\n\n* **cellUpdate()**\n\n\tCalled each time the cell appears on screen. You can change the appearance here using variables that may not be present on cellSetup().\n\n* **onCellHighlightChanged()**\n\n  Called whenever the cell or any subview become or resign the first responder.\n\n* **onRowValidationChanged()**\n\n    Called whenever the the validation errors associated with a row changes.\n\n* **onExpandInlineRow()**\n\n  Called before expanding the inline row. Applies to rows conforming `InlineRowType` protocol.\n\n* **onCollapseInlineRow()**\n\n  Called before collapsing the inline row. Applies to rows conforming `InlineRowType` protocol.\n\n* **onPresent()**\n\n\tCalled by a row just before presenting another view controller. Applies to rows conforming `PresenterRowType` protocol. Use it to set up the presented controller.\n\n\n### Section Header and Footer\n\nYou can set a title `String` or a custom `View` as the header or footer of a `Section`.\n\n#### String title\n```swift\nSection(\"Title\")\n\nSection(header: \"Title\", footer: \"Footer Title\")\n\nSection(footer: \"Footer Title\")\n```\n\n#### Custom view\nYou can use a Custom View from a `.xib` file:\n\n```swift\nSection() { section in\n    var header = HeaderFooterView\u003CMyHeaderNibFile>(.nibFile(name: \"MyHeaderNibFile\", bundle: nil))\n\n    \u002F\u002F Will be called every time the header appears on screen\n    header.onSetupView = { view, _ in\n        \u002F\u002F Commonly used to setup texts inside the view\n        \u002F\u002F Don't change the view hierarchy or size here!\n    }\n    section.header = header\n}\n```\n\nOr a custom `UIView` created programmatically\n\n```swift\nSection(){ section in\n    var header = HeaderFooterView\u003CMyCustomUIView>(.class)\n    header.height = {100}\n    header.onSetupView = { view, _ in\n        view.backgroundColor = .red\n    }\n    section.header = header\n}\n```\nOr just build the view with a Callback\n```swift\nSection(){ section in\n    section.header = {\n          var header = HeaderFooterView\u003CUIView>(.callback({\n              let view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))\n              view.backgroundColor = .red\n              return view\n          }))\n          header.height = { 100 }\n          return header\n        }()\n}\n```\n\n### Dynamically hide and show rows (or sections)  \u003Ca name=\"hide-show-rows\">\u003C\u002Fa>\n\n\u003Cimg src=\"Example\u002FMedia\u002FEurekaSwitchSections.gif\" width=\"300\" alt=\"Screenshot of Hidden Rows\" \u002F>\n\nIn this case we are hiding and showing whole sections.\n\nTo accomplish this each row has a `hidden` variable of optional type `Condition` which can be set using a function or `NSPredicate`.\n\n\n#### Hiding using a function condition\n\nUsing the `function` case of `Condition`:\n```swift\nCondition.function([String], (Form)->Bool)\n```\nThe array of `String` to pass should contain the tags of the rows this row depends on. Each time the value of any of those rows changes the function is reevaluated.\nThe function then takes the `Form` and returns a `Bool` indicating whether the row should be hidden or not. This the most powerful way of setting up the `hidden` property as it has no explicit limitations of what can be done.\n\n```swift\nform +++ Section()\n            \u003C\u003C\u003C SwitchRow(\"switchRowTag\"){\n                $0.title = \"Show message\"\n            }\n            \u003C\u003C\u003C LabelRow(){\n\n                $0.hidden = Condition.function([\"switchRowTag\"], { form in\n                    return !((form.rowBy(tag: \"switchRowTag\") as? SwitchRow)?.value ?? false)\n                })\n                $0.title = \"Switch is on!\"\n        }\n```\n\n\u003Cimg src=\"Example\u002FMedia\u002FEurekaHidden.gif\" width=\"300\" alt=\"Screenshot of Hidden Rows\" \u002F>\n\n```swift\npublic enum Condition {\n    case function([String], (Form)->Bool)\n    case predicate(NSPredicate)\n}\n```\n\n#### Hiding using an NSPredicate\n\nThe `hidden` variable can also be set with a NSPredicate. In the predicate string you can reference values of other rows by their tags to determine if a row should be hidden or visible.\nThis will only work if the values of the rows the predicate has to check are NSObjects (String and Int will work as they are bridged to their ObjC counterparts, but enums won't work).\nWhy could it then be useful to use predicates when they are more limited? Well, they can be much simpler, shorter and readable than functions. Look at this example:\n\n```swift\n$0.hidden = Condition.predicate(NSPredicate(format: \"$switchTag == false\"))\n```\n\nAnd we can write it even shorter since `Condition` conforms to `ExpressibleByStringLiteral`:\n\n```swift\n$0.hidden = \"$switchTag == false\"\n```\n\n*Note: we will substitute the value of the row whose tag is 'switchTag' instead of '$switchTag'*\n\nFor all of this to work, **all of the implicated rows must have a tag** as the tag will identify them.\n\nWe can also hide a row by doing:\n```swift\n$0.hidden = true\n```\nas `Condition` conforms to `ExpressibleByBooleanLiteral`.\n\nNot setting the `hidden` variable will leave the row always visible.\n\nIf you manually set the hidden (or disabled) condition after the form has been displayed you may have to call `row.evaluateHidden()` to force Eureka to reevaluate the new condition.\nSee [this FAQ section](https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FEureka#row-does-not-update-after-changing-hidden-or-disabled-condition) for more info.\n\n##### Sections\nFor sections this works just the same. That means we can set up section `hidden` property to show\u002Fhide it dynamically.\n\n##### Disabling rows\nTo disable rows, each row has an `disabled` variable which is also an optional `Condition` type property. This variable also works the same as the `hidden` variable so that it requires the rows to have a tag.\n\nNote that if you want to disable a row permanently you can also set `disabled` variable to `true`.\n\n### List Sections\n\nTo display a list of options, Eureka includes a special section called `SelectableSection`.\nWhen creating one you need to pass the type of row to use in the options and the `selectionType`.\nThe `selectionType` is an enum which can be either `multipleSelection` or `singleSelection(enableDeselection: Bool)` where the `enableDeselection` parameter determines if the selected rows can be deselected or not.\n\n```swift\nform +++ SelectableSection\u003CListCheckRow\u003CString>>(\"Where do you live\", selectionType: .singleSelection(enableDeselection: true))\n\nlet continents = [\"Africa\", \"Antarctica\", \"Asia\", \"Australia\", \"Europe\", \"North America\", \"South America\"]\nfor option in continents {\n    form.last! \u003C\u003C\u003C ListCheckRow\u003CString>(option){ listRow in\n        listRow.title = option\n        listRow.selectableValue = option\n        listRow.value = nil\n    }\n}\n```\n\n##### What kind of rows can be used?\n\nTo create such a section you have to create a row that conforms the `SelectableRowType` protocol.\n\n```swift\npublic protocol SelectableRowType : RowType {\n    var selectableValue : Value? { get set }\n}\n```\n\nThis `selectableValue` is where the value of the row will be permanently stored. The `value` variable will be used to determine if the row is selected or not, being 'selectableValue' if selected or nil otherwise.\nEureka includes the `ListCheckRow` which is used for example. In the custom rows of the Examples project you can also find the `ImageCheckRow`.\n\n##### Getting the selected rows\n\nTo easily get the selected row\u002Fs of a `SelectableSection` there are two methods: `selectedRow()` and `selectedRows()` which can be called to get the selected row in case it is a `SingleSelection` section or all the selected rows if it is a `MultipleSelection` section.\n\n##### Grouping options in sections\n\nAdditionally you can setup list of options to be grouped by sections using following properties of `SelectorViewController`:\n\n- `sectionKeyForValue` - a closure that should return key for particular row value. This key is later used to break options by sections.\n\n- `sectionHeaderTitleForKey` - a closure that returns header title for a section for particular key. By default returns the key itself.\n\n- `sectionFooterTitleForKey` - a closure that returns footer title for a section for particular key.\n\n### Multivalued Sections\n\nEureka supports multiple values for a certain field (such as telephone numbers in a contact) by using Multivalued sections. It allows us to easily create insertable, deletable and reorderable sections.\n\n\u003Cimg src=\"Example\u002FMedia\u002FEurekaMultivalued.gif\" width=\"300\" alt=\"Screenshot of Multivalued Section\" \u002F>\n\n#### How to create a multivalued section\n\nIn order to create a multivalued section we have to use `MultivaluedSection` type instead of the regular `Section` type. `MultivaluedSection` extends `Section` and has some additional properties to configure multivalued section behavior.\n\nlet's dive into a code example...\n\n```swift\nform +++\n    MultivaluedSection(multivaluedOptions: [.Reorder, .Insert, .Delete],\n                       header: \"Multivalued TextField\",\n                       footer: \".Insert adds a 'Add Item' (Add New Tag) button row as last cell.\") {\n        $0.addButtonProvider = { section in\n            return ButtonRow(){\n                $0.title = \"Add New Tag\"\n            }\n        }\n        $0.multivaluedRowToInsertAt = { index in\n            return NameRow() {\n                $0.placeholder = \"Tag Name\"\n            }\n        }\n        $0 \u003C\u003C\u003C NameRow() {\n            $0.placeholder = \"Tag Name\"\n        }\n    }\n```\n\nPrevious code snippet shows how to create a multivalued section. In this case we want to insert, delete and reorder rows as multivaluedOptions argument indicates.\n\n`addButtonProvider` allows us to customize the button row which inserts a new row when tapped and `multivaluedOptions` contains `.Insert` value.\n\n`multivaluedRowToInsertAt` closure property is called by Eureka each time a new row needs to be inserted. In order to provide the row to add into multivalued section we should set this property. Eureka passes the index as closure parameter. Notice that we can return any kind of row, even custom rows, even though in most cases multivalued section rows are of the same type.\n\nEureka automatically adds a button row when we create a insertable multivalued section. We can customize how the this button row looks like as we explained before. `showInsertIconInAddButton` property indicates if plus button (insert style) should appear in the left of the button, true by default.\n\nThere are some considerations we need to have in mind when creating insertable sections. Any row added to the insertable multivalued section should be placed above the row that Eureka automatically adds to insert new rows. This can be easily achieved by adding these additional rows to the section from inside the section's initializer closure (last parameter of section initializer) so then Eureka adds the adds insert button at the end of the section.\n\n#### Editing mode\n\nBy default Eureka will set the tableView's `isEditing` to true only if there is a MultivaluedSection in the form. This will be done in `viewWillAppear` the first time a form is presented.\n\nFor more information on how to use multivalued sections please take a look at Eureka example project which contains several usage examples.\n\n#### Custom add button\nIf you want to use an add button which is not a `ButtonRow` then you can use `GenericMultivaluedSection\u003CAddButtonType>`, where `AddButtonType` is the type of the row you want to use as add button. This is useful if you want to use a custom row to change the UI of the button.\n\nExample:\n\n```swift\nGenericMultivaluedSection\u003CLabelRow>(multivaluedOptions: [.Reorder, .Insert, .Delete], {\n    $0.addButtonProvider = { section in\n        return LabelRow(){\n            $0.title = \"A Label row as add button\"\n        }\n    }\n    \u002F\u002F ...\n}\n```\n\n### Validations\n\nEureka 2.0.0 introduces the much requested built-in validations feature.\n\nA row has a collection of `Rules` and a specific configuration that determines when validation rules should be evaluated.\n\nThere are some rules provided by default, but you can also create new ones on your own.\n\nThe provided rules are:\n* RuleRequired\n* RuleEmail\n* RuleURL\n* RuleGreaterThan, RuleGreaterOrEqualThan, RuleSmallerThan, RuleSmallerOrEqualThan\n* RuleMinLength, RuleMaxLength\n* RuleClosure\n\nLet's see how to set up the validation rules.\n\n```swift\n\noverride func viewDidLoad() {\n        super.viewDidLoad()\n        form\n          +++ Section(header: \"Required Rule\", footer: \"Options: Validates on change\")\n\n            \u003C\u003C\u003C TextRow() {\n                $0.title = \"Required Rule\"\n                $0.add(rule: RuleRequired())\n\n\t\t\u002F\u002F This could also have been achieved using a closure that returns nil if valid, or a ValidationError otherwise.\n\t\t\u002F*\n\t\tlet ruleRequiredViaClosure = RuleClosure\u003CString> { rowValue in\n\t\treturn (rowValue == nil || rowValue!.isEmpty) ? ValidationError(msg: \"Field required!\") : nil\n\t\t}\n\t\t$0.add(rule: ruleRequiredViaClosure)\n\t\t*\u002F\n\n                $0.validationOptions = .validatesOnChange\n            }\n            .cellUpdate { cell, row in\n                if !row.isValid {\n                    cell.titleLabel?.textColor = .systemRed\n                }\n            }\n\n          +++ Section(header: \"Email Rule, Required Rule\", footer: \"Options: Validates on change after blurred\")\n\n            \u003C\u003C\u003C TextRow() {\n                $0.title = \"Email Rule\"\n                $0.add(rule: RuleRequired())\n                $0.add(rule: RuleEmail())\n                $0.validationOptions = .validatesOnChangeAfterBlurred\n            }\n            .cellUpdate { cell, row in\n                if !row.isValid {\n                    cell.titleLabel?.textColor = .systemRed\n                }\n            }\n\n```\n\nAs you can see in the previous code snippet we can set up as many rules as we want in a row by invoking row's `add(rule:)` function.\n\nRow also provides  `func remove(ruleWithIdentifier identifier: String)` to remove a rule. In order to use it we must assign an id to the rule after creating it.\n\nSometimes the collection of rules we want to use on a row is the same we want to use on many other rows. In this case we can set up all validation rules using a `RuleSet` which is a collection of validation rules.\n\n```swift\nvar rules = RuleSet\u003CString>()\nrules.add(rule: RuleRequired())\nrules.add(rule: RuleEmail())\n\nlet row = TextRow() {\n            $0.title = \"Email Rule\"\n            $0.add(ruleSet: rules)\n            $0.validationOptions = .validatesOnChangeAfterBlurred\n        }\n```\n\nEureka allows us to specify when validation rules should be evaluated. We can do it by setting up `validationOptions` row's property, which can have the following values:\n\n\n* `.validatesOnChange` - Validates whenever a row value changes.\n* `.validatesOnBlur` - (Default value) validates right after the cell resigns first responder. Not applicable for all rows.\n* `.validatesOnChangeAfterBlurred` - Validates whenever the row value changes after it resigns first responder for the first time.\n* `.validatesOnDemand` - We should manually validate the row or form by invoking `validate()` method.\n\nIf you want to validate the entire form (all the rows) you can manually invoke Form `validate()` method.\n\n#### How to get validation errors\n\nEach row has the `validationErrors` property that can be used to retrieve all validation errors. This property just holds the validation error list of the latest row validation execution, which means it doesn't evaluate the validation rules of the row.\n\n#### Note on types\n\nAs expected, the Rules must use the same types as the Row object. Be extra careful to check the row type used. You might see a compiler error (\"Incorrect arugment label in call (have 'rule:' expected 'ruleSet:')\" that is not pointing to the problem when mixing types.\n\n### Swipe Actions\n\nBy using swipe actions we can define multiple `leadingSwipe` and `trailingSwipe` actions per row. As swipe actions depend on iOS system features, `leadingSwipe` is available on iOS 11.0+ only.\n\nLet's see how to define swipe actions.\n\n```swift\nlet row = TextRow() {\n            let deleteAction = SwipeAction(\n                style: .destructive,\n                title: \"Delete\",\n                handler: { (action, row, completionHandler) in\n                    \u002F\u002Fadd your code here.\n                    \u002F\u002Fmake sure you call the completionHandler once done.\n                    completionHandler?(true)\n                })\n            deleteAction.image = UIImage(named: \"icon-trash\")\n\n            $0.trailingSwipe.actions = [deleteAction]\n            $0.trailingSwipe.performsFirstActionWithFullSwipe = true\n\n            \u002F\u002Fplease be aware: `leadingSwipe` is only available on iOS 11+ only\n            let infoAction = SwipeAction(\n                style: .normal,\n                title: \"Info\",\n                handler: { (action, row, completionHandler) in\n                    \u002F\u002Fadd your code here.\n                    \u002F\u002Fmake sure you call the completionHandler once done.\n                    completionHandler?(true)\n                })\n            infoAction.actionBackgroundColor = .blue\n            infoAction.image = UIImage(named: \"icon-info\")\n\n            $0.leadingSwipe.actions = [infoAction]\n            $0.leadingSwipe.performsFirstActionWithFullSwipe = true\n        }\n```\n\nSwipe Actions need `tableView.isEditing` be set to `false`. Eureka will set this to `true` if there is a MultivaluedSection in the form (in the `viewWillAppear`).\nIf you have both MultivaluedSections and swipe actions in the same form you should set `isEditing` according to your needs.\n\n## Custom rows\n\nIt is very common that you need a row that is different from those included in Eureka. If this is the case you will have to create your own row but this should not be difficult. You can read [this tutorial on how to create custom rows](https:\u002F\u002Fblog.xmartlabs.com\u002F2016\u002F09\u002F06\u002FEureka-custom-row-tutorial\u002F) to get started. You might also want to have a look at [EurekaCommunity] which includes some extra rows ready to be added to Eureka.\n\n### Basic custom rows\n\nTo create a row with custom behaviour and appearance you'll probably want to create subclasses of `Row` and `Cell`.\n\nRemember that `Row` is the abstraction Eureka uses, while the `Cell` is the actual `UITableViewCell` in charge of the view.\nAs the `Row` contains the `Cell`, both `Row` and `Cell` must be defined for the same **value** type.\n\n```swift\n\u002F\u002F Custom Cell with value type: Bool\n\u002F\u002F The cell is defined using a .xib, so we can set outlets :)\npublic class CustomCell: Cell\u003CBool>, CellType {\n    @IBOutlet weak var switchControl: UISwitch!\n    @IBOutlet weak var label: UILabel!\n\n    public override func setup() {\n        super.setup()\n        switchControl.addTarget(self, action: #selector(CustomCell.switchValueChanged), for: .valueChanged)\n    }\n\n    func switchValueChanged(){\n        row.value = switchControl.on\n        row.updateCell() \u002F\u002F Re-draws the cell which calls 'update' bellow\n    }\n\n    public override func update() {\n        super.update()\n        backgroundColor = (row.value ?? false) ? .white : .black\n    }\n}\n\n\u002F\u002F The custom Row also has the cell: CustomCell and its correspond value\npublic final class CustomRow: Row\u003CCustomCell>, RowType {\n    required public init(tag: String?) {\n        super.init(tag: tag)\n        \u002F\u002F We set the cellProvider to load the .xib corresponding to our cell\n        cellProvider = CellProvider\u003CCustomCell>(nibName: \"CustomCell\")\n    }\n}\n```\nThe result: \u003Cbr>\n\u003Cimg src=\"Example\u002FMedia\u002FEurekaCustomRow.gif\" alt=\"Screenshot of Disabled Row\"\u002F>\n\n\u003Cbr>\nCustom rows need to subclass `Row\u003CCellType>` and conform to `RowType` protocol.\nCustom cells need to subclass `Cell\u003CValueType>` and conform to `CellType` protocol.\n\nJust like the callbacks cellSetup and CellUpdate, the `Cell` has the setup and update methods where you can customize it.\n\n\n### Custom inline rows\n\nAn inline row is a specific type of row that shows dynamically a row below it, normally an inline row changes between an expanded and collapsed mode whenever the row is tapped.\n\nSo to create an inline row we need 2 rows, the row that is \"always\" visible and the row that will expand\u002Fcollapse.\n\nAnother requirement is that the value type of these 2 rows must be the same. This means if one row holds a `String` value then the other must have a `String` value too.\n\nOnce we have these 2 rows, we should make the top row type conform to `InlineRowType`.\nThis protocol requires you to define an `InlineRow` typealias and a `setupInlineRow` function.\nThe `InlineRow` type will be the type of the row that will expand\u002Fcollapse.\nTake this as an example:\n\n```swift\nclass PickerInlineRow\u003CT> : Row\u003CPickerInlineCell\u003CT>> where T: Equatable {\n\n    public typealias InlineRow = PickerRow\u003CT>\n    open var options = [T]()\n\n    required public init(tag: String?) {\n        super.init(tag: tag)\n    }\n\n    public func setupInlineRow(_ inlineRow: InlineRow) {\n        inlineRow.options = self.options\n        inlineRow.displayValueFor = self.displayValueFor\n        inlineRow.cell.height = { UITableViewAutomaticDimension }\n    }\n}\n```\n\nThe `InlineRowType` will also add some methods to your inline row:\n\n```swift\nfunc expandInlineRow()\nfunc collapseInlineRow()\nfunc toggleInlineRow()\n```\n\nThese methods should work fine but should you want to override them keep in mind that it is `toggleInlineRow` that has to call `expandInlineRow` and `collapseInlineRow`.\n\nFinally you must invoke `toggleInlineRow()` when the row is selected, for example overriding `customDidSelect`:\n\n```swift\npublic override func customDidSelect() {\n    super.customDidSelect()\n    if !isDisabled {\n        toggleInlineRow()\n    }\n}\n```\n\n### Custom Presenter rows\n\n**Note:** *A Presenter row is a row that presents a new UIViewController.*\n\nTo create a custom Presenter row you must create a class that conforms the `PresenterRowType` protocol. It is highly recommended to subclass `SelectorRow` as it does conform to that protocol and adds other useful functionality.\n\nThe PresenterRowType protocol is defined as follows:\n```swift\npublic protocol PresenterRowType: TypedRowType {\n\n     associatedtype PresentedControllerType : UIViewController, TypedRowControllerType\n\n     \u002F\u002F\u002F Defines how the view controller will be presented, pushed, etc.\n     var presentationMode: PresentationMode\u003CPresentedControllerType>? { get set }\n\n     \u002F\u002F\u002F Will be called before the presentation occurs.\n     var onPresentCallback: ((FormViewController, PresentedControllerType) -> Void)? { get set }\n}\n```\n\nThe onPresentCallback will be called when the row is about to present another view controller. This is done in the `SelectorRow` so if you do not subclass it you will have to call it yourself.\n\nThe `presentationMode` is what defines how the controller is presented and which controller is presented. This presentation can be using a Segue identifier, a segue class, presenting a controller modally or pushing to a specific view controller. For example a CustomPushRow can be defined like this:\n\n\nLet's see an example..\n\n```swift\n\n\u002F\u002F\u002F Generic row type where a user must select a value among several options.\nopen class SelectorRow\u003CCell: CellType>: OptionsRow\u003CCell>, PresenterRowType where Cell: BaseCell {\n\n\n    \u002F\u002F\u002F Defines how the view controller will be presented, pushed, etc.\n    open var presentationMode: PresentationMode\u003CSelectorViewController\u003CSelectorRow\u003CCell>>>?\n\n    \u002F\u002F\u002F Will be called before the presentation occurs.\n    open var onPresentCallback: ((FormViewController, SelectorViewController\u003CSelectorRow\u003CCell>>) -> Void)?\n\n    required public init(tag: String?) {\n        super.init(tag: tag)\n    }\n\n    \u002F**\n     Extends `didSelect` method\n     *\u002F\n    open override func customDidSelect() {\n        super.customDidSelect()\n        guard let presentationMode = presentationMode, !isDisabled else { return }\n        if let controller = presentationMode.makeController() {\n            controller.row = self\n            controller.title = selectorTitle ?? controller.title\n            onPresentCallback?(cell.formViewController()!, controller)\n            presentationMode.present(controller, row: self, presentingController: self.cell.formViewController()!)\n        } else {\n            presentationMode.present(nil, row: self, presentingController: self.cell.formViewController()!)\n        }\n    }\n\n    \u002F**\n     Prepares the pushed row setting its title and completion callback.\n     *\u002F\n    open override func prepare(for segue: UIStoryboardSegue) {\n        super.prepare(for: segue)\n        guard let rowVC = segue.destination as Any as? SelectorViewController\u003CSelectorRow\u003CCell>> else { return }\n        rowVC.title = selectorTitle ?? rowVC.title\n        rowVC.onDismissCallback = presentationMode?.onDismissCallback ?? rowVC.onDismissCallback\n        onPresentCallback?(cell.formViewController()!, rowVC)\n        rowVC.row = self\n    }\n}\n\n\n\u002F\u002F SelectorRow conforms to PresenterRowType\npublic final class CustomPushRow\u003CT: Equatable>: SelectorRow\u003CPushSelectorCell\u003CT>>, RowType {\n\n    public required init(tag: String?) {\n        super.init(tag: tag)\n        presentationMode = .show(controllerProvider: ControllerProvider.callback {\n            return SelectorViewController\u003CT>(){ _ in }\n            }, onDismiss: { vc in\n                _ = vc.navigationController?.popViewController(animated: true)\n        })\n    }\n}\n```\n\n\n### Subclassing cells using the same row\n\nSometimes we want to change the UI look of one of our rows but without changing the row type and all the logic associated to one row.\nThere is currently one way to do this **if you are using cells that are instantiated from nib files**. Currently, none of Eureka's core rows are instantiated from nib files but some of the custom rows in [EurekaCommunity] are, in particular the [PostalAddressRow](https:\u002F\u002Fgithub.com\u002FEurekaCommunity\u002FPostalAddressRow) which was moved there.\n\nWhat you have to do is:\n* Create a nib file containing the cell you want to create.\n* Then set the class of the cell to be the existing cell you want to modify (if you want to change something more apart from pure UI then you should subclass that cell). Make sure the module of that class is correctly set\n* Connect the outlets to your class\n* Tell your row to use the new nib file. This is done by setting the `cellProvider` variable to use this nib. You should do this in the initialiser, either in each concrete instantiation or using the `defaultRowInitializer`. For example:\n\n```swift\n\u003C\u003C\u003C PostalAddressRow() {\n     $0.cellProvider = CellProvider\u003CPostalAddressCell>(nibName: \"CustomNib\", bundle: Bundle.main)\n}\n```\n\nYou could also create a new row for this. In that case try to inherit from the same superclass as the row you want to change to inherit its logic.\n\nThere are some things to consider when you do this:\n* If you want to see an example have a look at the [PostalAddressRow](https:\u002F\u002Fgithub.com\u002FEurekaCommunity\u002FPostalAddressRow) or the [CreditCardRow](https:\u002F\u002Fgithub.com\u002FEurekaCommunity\u002FCreditCardRow) which have use a custom nib file in their examples.\n* If you get an error saying `Unknown class \u003CYOUR_CLASS_NAME> in Interface Builder file`, it might be that you have to instantiate that new type somewhere in your code to load it in the runtime. Calling `let t = YourClass.self` helped in my case.\n\n\n## Row catalog\n\n### Controls Rows\n\u003Ctable>\n    \u003Ctr>\n        \u003Ctd>\u003Ccenter>\u003Cb>Label Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FLabelRow.png\"\u002F>\n        \u003C\u002Fcenter>\u003Cbr>\u003Cbr>\n        \u003C\u002Ftd>\n        \u003Ctd>\u003Ccenter>\u003Cb>Button Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FButtonRow.png\"\u002F>\n        \u003C\u002Fcenter>\u003Cbr>\u003Cbr>\n        \u003C\u002Ftd>\n        \u003Ctd>\u003Ccenter>\u003Cb>Check Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FCheckRow.png\"\u002F>\n        \u003C\u002Fcenter>\u003Cbr>\u003Cbr>\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>\u003Ccenter>\u003Cb>Switch Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FSwitchRow.png\"\u002F>\n        \u003C\u002Fcenter>\u003Cbr>\u003Cbr>\n        \u003C\u002Ftd>\n        \u003Ctd>\u003Ccenter>\u003Cb>Slider Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FSliderRow.png\"\u002F>\n        \u003C\u002Fcenter>\u003Cbr>\u003Cbr>\n        \u003C\u002Ftd>\n        \u003Ctd>\u003Ccenter>\u003Cb>Stepper Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FStepperRow.png\"\u002F>\n        \u003C\u002Fcenter>\u003Cbr>\u003Cbr>\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>\u003Ccenter>\u003Cb>Text Area Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FTextAreaRow.png\"\u002F>\n        \u003C\u002Fcenter>\u003Cbr>\u003Cbr>\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### Field Rows\nThese rows have a textfield on the right side of the cell. The difference between each one of them consists in a different capitalization, autocorrection and keyboard type configuration.\n\n\u003Ctable>\n\u003Ctr>\n  \u003Ctd>\n    \u003Cimg src=\"Example\u002FMedia\u002FCatalogFieldRows.jpg\" width=\"300\"\u002F>\n  \u003C\u002Ftd>\n  \u003Ctd>\n  TextRow\u003Cbr>\u003Cbr>\n  NameRow\u003Cbr>\u003Cbr>\n  URLRow\u003Cbr>\u003Cbr>\n  IntRow\u003Cbr>\u003Cbr>\n  PhoneRow\u003Cbr>\u003Cbr>\n  PasswordRow\u003Cbr>\u003Cbr>\n  EmailRow\u003Cbr>\u003Cbr>\n  DecimalRow\u003Cbr>\u003Cbr>\n  TwitterRow\u003Cbr>\u003Cbr>\n  AccountRow\u003Cbr>\u003Cbr>\n  ZipCodeRow\n  \u003C\u002Ftd>\n\u003Ctr>\n\u003C\u002Ftable>\n\nAll of the `FieldRow` subtypes above have a `formatter` property of type \u003Ca href=\"https:\u002F\u002Fdeveloper.apple.com\u002Flibrary\u002Fmac\u002Fdocumentation\u002FCocoa\u002FReference\u002FFoundation\u002FClasses\u002FNSFormatter_Class\u002F\">`NSFormatter`\u003C\u002Fa> which can be set to determine how that row's value should be displayed. A custom formatter for numbers with two digits after the decimal mark is included with Eureka (`DecimalFormatter`). The Example project also contains a `CurrencyFormatter` which displays a number as currency according to the user's locale.\n\nBy default, setting a row's `formatter` only affects how a value is displayed when it is not being edited. To also format the value while the row is being edited, set `useFormatterDuringInput` to `true` when initializing the row. Formatting the value as it is being edited may require updating the cursor position and Eureka provides the following protocol that your formatter should conform to in order to handle cursor position:\n\n```swift\npublic protocol FormatterProtocol {\n    func getNewPosition(forPosition forPosition: UITextPosition, inTextInput textInput: UITextInput, oldValue: String?, newValue: String?) -> UITextPosition\n}\n```\n\nAdditionally, `FieldRow` subtypes have a `useFormatterOnDidBeginEditing` property. When using a `DecimalRow` with a formatter that allows decimal values and conforms to the user's locale (e.g. `DecimalFormatter`), if `useFormatterDuringInput` is `false`, `useFormatterOnDidBeginEditing` must be set to `true` so that the decimal mark in the value being edited matches the decimal mark on the keyboard.\n\n### Date Rows\n\nDate Rows hold a Date and allow us to set up a new value through UIDatePicker control. The mode of the UIDatePicker and the way how the date picker view is shown is what changes between them.\n\u003Ctable>\n\u003Ctr>\n\u003Ctd>\n\u003Ccenter>\u003Cb>Date Row\u003C\u002Fb>\n\u003Cimg src=\"Example\u002FMedia\u002FRowGifs\u002FEurekaDateRow.gif\" height=\"220\" width=\"230\" \u002F>\n\u003Cbr>\nPicker shown in the keyboard.\n\u003C\u002Fcenter>\n\u003C\u002Ftd>\n\u003Ctd>\n\u003Ccenter>\u003Cb>Date Row (Inline)\u003C\u002Fb>\n\u003Cimg src=\"Example\u002FMedia\u002FRowGifs\u002FEurekaDateInlineRow.gif\" height=\"220\" width=\"210\"\u002F>\n\u003Cbr>\nThe row expands.\n\u003C\u002Fcenter>\n\u003C\u002Ftd>\n\u003Ctd>\n\u003Ccenter>\u003Cb>Date Row (Picker)\u003C\u002Fb>\n\u003Cimg src=\"Example\u002FMedia\u002FRowGifs\u002FEurekaDatePickerRow.gif\" height=\"220\" width=\"210\"\u002F>\n\u003Cbr>\nThe picker is always visible.\n\u003C\u002Fcenter>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\nWith those 3 styles (Normal, Inline & Picker), Eureka includes:\n\n+ **DateRow**\n+ **TimeRow**\n+ **DateTimeRow**\n+ **CountDownRow**\n\n### Option Rows\nThese are rows with a list of options associated from which the user must choose.\n\n```swift\n\u003C\u003C\u003C ActionSheetRow\u003CString>() {\n                $0.title = \"ActionSheetRow\"\n                $0.selectorTitle = \"Pick a number\"\n                $0.options = [\"One\",\"Two\",\"Three\"]\n                $0.value = \"Two\"    \u002F\u002F initially selected\n            }\n```\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd width=\"25%\">\n\u003Ccenter>\u003Cb>Alert Row\u003C\u002Fb>\u003Cbr>\n\u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FAlertRow.jpeg\"\u002F>\n\u003Cbr>\nWill show an alert with the options to choose from.\n\u003C\u002Fcenter>\n\u003C\u002Ftd>\n\u003Ctd width=\"25%\">\n\u003Ccenter>\u003Cb>ActionSheet Row\u003C\u002Fb>\u003Cbr>\n\u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FActionSheetRow.jpeg\"\u002F>\n\u003Cbr>\nWill show an action sheet with the options to choose from.\n\u003C\u002Fcenter>\n\u003C\u002Ftd>\n\u003Ctd width=\"25%\">\n\u003Ccenter>\u003Cb>Push Row\u003C\u002Fb>\u003Cbr>\n\u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FPushRow.jpeg\"\u002F>\n\u003Cbr>\nWill push to a new controller from where to choose options listed using Check rows.\n\u003C\u002Fcenter>\n\u003C\u002Ftd>\n\u003Ctd width=\"25%\">\n\u003Ccenter>\u003Cb>Multiple Selector Row\u003C\u002Fb>\u003Cbr>\n\u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FMultipleSelectorRow.jpeg\"\u002F>\n\u003Cbr>\nLike PushRow but allows the selection of multiple options.\n\u003C\u002Fcenter>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\u003Ctable>\n    \u003Ctr>\n        \u003Ctd>\u003Ccenter>\u003Cb>Segmented Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FSegmentedRow.png\"\u002F>\n        \u003C\u002Fcenter>\n        \u003C\u002Ftd>\n        \u003Ctd>\u003Ccenter>\u003Cb>Segmented Row (w\u002FTitle)\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FSegmentedRowWithTitle.png\"\u002F>\n        \u003C\u002Fcenter>\n        \u003C\u002Ftd>\n        \u003Ctd>\u003Ccenter>\u003Cb>Picker Row\u003C\u002Fb>\u003Cbr>\n        \u003Cimg src=\"Example\u002FMedia\u002FRowStatics\u002FPickerRow.png\"\u002F>\n        \u003Cbr>Presents options of a generic type through a picker view\n        \u003Cbr>\u003Cb>(There is also Picker Inline Row)\u003C\u002Fb>\n        \u003C\u002Fcenter>\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### Built your own custom row?\nLet us know about it, we would be glad to mention it here. :)\n\n* **LocationRow** (Included as custom row in the example project)\n\n\u003Cimg src=\"Example\u002FMedia\u002FEurekaLocationRow.gif\" width=\"300\" alt=\"Screenshot of Location Row\"\u002F>\n\n## Installation\n\n#### CocoaPods\n\n[CocoaPods](https:\u002F\u002Fcocoapods.org\u002F) is a dependency manager for Cocoa projects.\n\nSpecify Eureka into your project's `Podfile`:\n\n```ruby\nsource 'https:\u002F\u002Fgithub.com\u002FCocoaPods\u002FSpecs.git'\nplatform :ios, '9.0'\nuse_frameworks!\n\npod 'Eureka'\n```\n\nThen run the following command:\n\n```bash\n$ pod install\n```\n\n#### Swift Package Manager\n\n[Swift Package Manager](https:\u002F\u002Fswift.org\u002Fpackage-manager\u002F) is a tool for managing the distribution of Swift code.\n\nAfter you set up your `Package.swift` manifest file, you can add Eureka as a dependency by adding it to the dependencies value of your `Package.swift`.\n\ndependencies: [\n    .package(url: \"https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FEureka.git\", from: \"5.5.0\")\n]\n\n\n#### Carthage\n\n[Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) is a simple, decentralized dependency manager for Cocoa.\n\nSpecify Eureka into your project's `Cartfile`:\n\n```ogdl\ngithub \"xmartlabs\u002FEureka\" ~> 5.5\n```\n\n#### Manually as Embedded Framework\n\n* Clone Eureka as a git [submodule](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-submodule) by running the following command from your project root git folder.\n\n```bash\n$ git submodule add https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FEureka.git\n```\n\n* Open Eureka folder that was created by the previous git submodule command and drag the Eureka.xcodeproj into the Project Navigator of your application's Xcode project.\n\n* Select the Eureka.xcodeproj in the Project Navigator and verify the deployment target matches with your application deployment target.\n\n* Select your project in the Xcode Navigation and then select your application target from the sidebar. Next select the \"General\" tab and click on the + button under the \"Embedded Binaries\" section.\n\n* Select `Eureka.framework` and we are done!\n\n## Getting involved\n\n* If you **want to contribute** please feel free to **submit pull requests**.\n* If you **have a feature request** please **open an issue**.\n* If you **found a bug** check older issues before submitting an issue.\n* If you **need help** or would like to **ask general question**, use [StackOverflow]. (Tag `eureka-forms`).\n\n**Before contribute check the [CONTRIBUTING](CONTRIBUTING.md) file for more info.**\n\nIf you use **Eureka** in your app We would love to hear about it! Drop us a line on [twitter].\n\n## Authors\n\n* [Martin Barreto](https:\u002F\u002Fgithub.com\u002FmtnBarreto) ([@mtnBarreto](https:\u002F\u002Ftwitter.com\u002FmtnBarreto))\n* [Mathias Claassen](https:\u002F\u002Fgithub.com\u002Fmats-claassen) ([@mClaassen26](https:\u002F\u002Ftwitter.com\u002FmClaassen26))\n\n## FAQ\n\n#### How to change the text representation of the row value shown in the  cell.\n\nEvery row has the following property:\n\n```swift\n\u002F\u002F\u002F Block variable used to get the String that should be displayed for the value of this row.\npublic var displayValueFor: ((T?) -> String?)? = {\n    return $0.map { String(describing: $0) }\n}\n```\n\nYou can set `displayValueFor` according the string value you want to display.\n\n#### How to get a Row using its tag value\n\nWe can get a particular row by invoking any of the following functions exposed by the `Form` class:\n\n```swift\npublic func rowBy\u003CT: Equatable>(tag: String) -> RowOf\u003CT>?\npublic func rowBy\u003CRow: RowType>(tag: String) -> Row?\npublic func rowBy(tag: String) -> BaseRow?\n```\n\nFor instance:\n\n```swift\nlet dateRow : DateRow? = form.rowBy(tag: \"dateRowTag\")\nlet labelRow: LabelRow? = form.rowBy(tag: \"labelRowTag\")\n\nlet dateRow2: Row\u003CDateCell>? = form.rowBy(tag: \"dateRowTag\")\n\nlet labelRow2: BaseRow? = form.rowBy(tag: \"labelRowTag\")\n```\n\n#### How to get a Section using its tag value\n\n```swift\nlet section: Section?  = form.sectionBy(tag: \"sectionTag\")\n```\n\n#### How to set the form values using a dictionary\n\nInvoking `setValues(values: [String: Any?])` which is exposed by `Form` class.\n\nFor example:\n\n```swift\nform.setValues([\"IntRowTag\": 8, \"TextRowTag\": \"Hello world!\", \"PushRowTag\": Company(name:\"Xmartlabs\")])\n```\n\nWhere `\"IntRowTag\"`, `\"TextRowTag\"`, `\"PushRowTag\"` are row tags (each one uniquely identifies a row) and `8`, `\"Hello world!\"`, `Company(name:\"Xmartlabs\")` are the corresponding row value to assign.\n\nThe value type of a row must match with the value type of the corresponding dictionary value otherwise nil will be assigned.\n\nIf the form was already displayed we have to reload the visible rows either by reloading the table view `tableView.reloadData()` or invoking `updateCell()` to each visible row.\n\n#### Row does not update after changing hidden or disabled condition\n\nAfter setting a condition, this condition is not automatically evaluated. If you want it to do so immediately you can call `.evaluateHidden()` or `.evaluateDisabled()`.\n\nThis functions are just called when a row is added to the form and when a row it depends on changes. If the condition is changed when the row is being displayed then it must be reevaluated manually.\n\n#### onCellUnHighlight doesn't get called unless onCellHighlight is also defined\n\nLook at this [issue](https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FEureka\u002Fissues\u002F96).\n\n#### How to update a Section header\u002Ffooter\n\n* Set up a new header\u002Ffooter data ....\n\n```swift\nsection.header = HeaderFooterView(title: \"Header title \\(variable)\") \u002F\u002F use String interpolation\n\u002F\u002For\nvar header = HeaderFooterView\u003CUIView>(.class) \u002F\u002F most flexible way to set up a header using any view type\nheader.height = { 60 }  \u002F\u002F height can be calculated\nheader.onSetupView = { view, section in  \u002F\u002F each time the view is about to be displayed onSetupView is invoked.\n    view.backgroundColor = .orange\n}\nsection.header = header\n```\n\n* Reload the Section to perform the changes\n\n```swift\nsection.reload()\n```\n\n#### How to customize Selector and MultipleSelector option cells\n\n`selectableRowSetup`, `selectableRowCellUpdate` and `selectableRowCellSetup` properties are provided to be able to customize SelectorViewController and MultipleSelectorViewController selectable cells.\n\n```swift\nlet row = PushRow\u003CEmoji>() {\n              $0.title = \"PushRow\"\n              $0.options = [💁🏻, 🍐, 👦🏼, 🐗, 🐼, 🐻]\n              $0.value = 👦🏼\n              $0.selectorTitle = \"Choose an Emoji!\"\n          }.onPresent { from, to in\n              to.dismissOnSelection = false\n              to.dismissOnChange = false\n              to.selectableRowSetup = { row in\n                  row.cellProvider = CellProvider\u003CListCheckCell\u003CEmoji>>(nibName: \"EmojiCell\", bundle: Bundle.main)\n              }\n              to.selectableRowCellUpdate = { cell, row in\n                  cell.textLabel?.text = \"Text \" + row.selectableValue!  \u002F\u002F customization\n                  cell.detailTextLabel?.text = \"Detail \" +  row.selectableValue!\n              }\n          }\n\n```\n\n#### Don't want to use Eureka custom operators?\n\nAs we've said `Form` and `Section` types conform to `MutableCollection` and `RangeReplaceableCollection`. A Form is a collection of Sections and a Section is a collection of Rows.\n\n`RangeReplaceableCollection` protocol extension provides many useful methods to modify collection.\n\n```swift\nextension RangeReplaceableCollection {\n    public mutating func append(_ newElement: Self.Element)\n    public mutating func append\u003CS>(contentsOf newElements: S) where S : Sequence, Self.Element == S.Element\n    public mutating func insert(_ newElement: Self.Element, at i: Self.Index)\n    public mutating func insert\u003CS>(contentsOf newElements: S, at i: Self.Index) where S : Collection, Self.Element == S.Element\n    public mutating func remove(at i: Self.Index) -> Self.Element\n    public mutating func removeSubrange(_ bounds: Range\u003CSelf.Index>)\n    public mutating func removeFirst(_ n: Int)\n    public mutating func removeFirst() -> Self.Element\n    public mutating func removeAll(keepingCapacity keepCapacity: Bool)\n    public mutating func reserveCapacity(_ n: Self.IndexDistance)\n}\n```\n\nThese methods are used internally to implement the custom operators as shown bellow:\n\n```swift\npublic func +++(left: Form, right: Section) -> Form {\n    left.append(right)\n    return left\n}\n\npublic func +=\u003CC : Collection>(inout lhs: Form, rhs: C) where C.Element == Section {\n    lhs.append(contentsOf: rhs)\n}\n\npublic func \u003C\u003C\u003C(left: Section, right: BaseRow) -> Section {\n    left.append(right)\n    return left\n}\n\npublic func +=\u003CC : Collection>(inout lhs: Section, rhs: C) where C.Element == BaseRow {\n    lhs.append(contentsOf: rhs)\n}\n```\n\nYou can see how the rest of custom operators are implemented [here](https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FEureka\u002Fblob\u002Fmaster\u002FSource\u002FCore\u002FOperators.swift).\n\nIt's up to you to decide if you want to use Eureka custom operators or not.\n\n#### How to set up your form from a storyboard\nThe form is always displayed in a `UITableView`. You can set up your view controller in a storyboard and add a UITableView where you want it to be and then connect the outlet to FormViewController's `tableView` variable. This allows you to define a custom frame (possibly with constraints) for your form.\n\nAll of this can also be done by programmatically changing frame, margins, etc. of the `tableView` of your FormViewController.\n\n\n\u003C!--- In file -->\n[Introduction]: #introduction\n[Requirements]: #requirements\n\n[How to create a Form]: #how-to-create-a-form\n[Getting row values]: #getting-row-values\n[How to get the form values]: #how-to-get-the-form-values\n[Examples]: #examples\n[Usage]: #usage\n[Operators]: #operators\n[Rows]: #rows\n[Using the callbacks]: #using-the-callbacks\n[Section Header and Footer]: #section-header-and-footer\n[Custom rows]: #custom-rows\n[Basic custom rows]: #basic-custom-rows\n[Custom inline rows]: #custom-inline-rows\n[Custom presenter rows]: #custom-presenter-rows\n[How to create custom inline rows]: #how-to-create-custom-inline-rows\n[Custom rows catalog]: #custom-rows-catalog\n[Dynamically hide and show rows (or sections)]: #hide-show-rows\n[Implementing a custom Presenter row]: #custom-presenter-row\n[Extensibility]: #extensibility\n[Row catalog]: #row-catalog\n[Installation]: #installation\n[FAQ]: #faq\n\n[List sections]: #list-sections\n[Multivalued sections]: #multivalued-sections\n[Validations]: #validations\n[Swipe Actions]: #swipe-actions\n\n\u003C!--- In Project -->\n[CustomCellsController]: Example\u002FExample\u002FViewController.swift\n[FormViewController]: Example\u002FSource\u002FControllers.swift\n\n\u003C!--- External -->\n[XLForm]: https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FXLForm\n[DSL]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDomain-specific_language\n[StackOverflow]: http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Feureka-forms\n[our blog post]: http:\u002F\u002Fblog.xmartlabs.com\u002F2015\u002F09\u002F29\u002FIntroducing-Eureka-iOS-form-library-written-in-pure-Swift\u002F\n[twitter]: https:\u002F\u002Ftwitter.com\u002Fxmartlabs\n[EurekaCommunity]: https:\u002F\u002Fgithub.com\u002FEurekaCommunity\n\n# Donate to Eureka\n\nSo we can make Eureka even better!\u003Cbr>\u003Cbr>\n[\u003Cimg src=\"donate.png\"\u002F>](https:\u002F\u002Fwww.paypal.com\u002Fcgi-bin\u002Fwebscr?cmd=_s-xclick&hosted_button_id=HRMAH7WZ4QQ8E)\n\n# Change Log\n\nThis can be found in the [CHANGELOG.md](CHANGELOG.md) file.\n","Eureka 是一个用于构建优雅 iOS 表单的 Swift 库。它提供了丰富的表单组件，支持自定义行、动态显示\u002F隐藏行或节、多值节以及验证等功能，并且可以轻松集成到项目中。通过扩展 `FormViewController` 并使用链式语法添加节和行来创建表单，使得开发过程更加直观高效。Eureka 适用于需要复杂用户输入界面的应用场景，如注册表单、设置页面等，能够显著提升开发效率并保持代码整洁。",2,"2026-06-11 03:08:25","top_language"]