Download - Eureka wtb presentation - Mathias Classen
![Page 1: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/1.jpg)
Eureka
Mathias Claassen @mClaassen26
”“
Elegant form builder in Swift
www.github.com/xmartlabs/eureka
![Page 2: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/2.jpg)
Some of the apps using Eureka:
Dropbox, Chase Mobile, SoundCloud, Foursquare, AOL Radio, MLB.com,
Restaurant Story
![Page 3: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/3.jpg)
Key concepts:
● Form: Represents the form. Is a collection of sections● Section: Represents the sections of an UITableView● Row: Contains information about the rows of the form
○ Most important: value● Cell: The cells shown in an UITableView● FormViewController: subclass of UIViewController
![Page 4: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/4.jpg)
Rows and cells
● One-To-One Relation● They define each field of the form● Cells => UI part ● Rows => Logic part
![Page 5: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/5.jpg)
Operators● +++ (Appends Sections to forms)
● <<< (Appends rows to sections)
An example:
![Page 6: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/6.jpg)
Tags
● Tags identify rows and sections● They are optional● They are used to get values out of the form and other features like
making a row depend on the value of another
![Page 7: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/7.jpg)
Creating the first form
Some basic fields
![Page 8: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/8.jpg)
Section headers and footers
● Each section has header and footer basing on how UITableView works● Can be String or UIView● UIView can be loaded from Nib file, by calling a class init or created in a
callback block
![Page 9: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/9.jpg)
Let’s add a submit button to our form
![Page 10: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/10.jpg)
Customising cells
● All cells of a type: default row callbacks● One specific cell in a form:
○ cellSetup: One time customisation○ cellUpdate: When cell is re-displayed○ others
![Page 11: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/11.jpg)
cellSetup or cellUpdate?
cellSetup
● Called once after the cell is instantiated● Should set things that don’t change with
time (fonts, margins, etc.)
cellUpdate
● Called in cellForRowAtIndexPath● Should update the cell according to the
current value of the row● If you need the frame of the cell to be set
correctly: this is the place to customise
![Page 12: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/12.jpg)
Global cell settings
This are closures that can be set to a row class and which will be called for each instance of this type of row.
![Page 13: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/13.jpg)
onChange
● Called when the value of a row is changed ● We often want to execute something when the value of a row changes● This can be used to react to user interaction events
![Page 14: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/14.jpg)
Other features
● SelectableSection: a list of options● Hidden and disabled conditions
![Page 15: Eureka wtb presentation - Mathias Classen](https://reader036.vdocuments.us/reader036/viewer/2022092622/587984541a28ab6c358b615d/html5/thumbnails/15.jpg)
Demo
Thanks for watching!!