You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 30, 2019. It is now read-only.
Initialize a new manager for a specific UITableView instance
Reload
Signature
Description
reloadData()
Reload the data displayed by the managed table. Call it at the end of your operations in order to reflect made changes. Reload is not animated.
update(animation:block:)
Allows to perform a batch of operations on table's sections and rows. At the end of the block animations are collected and executed to reflect into the UI changes applied to the model.
Add rows to a section, if section is nil a new section is appened with rows at the end of table
add(rows: [RowProtocol], inSectionAt index: Int?)
Add rows to a section specified at index (If nil is passed rows will be added to the last section of the table. If no sections are available, a new section with passed rows will be created automatically)
add(row: RowProtocol, in section: Section? = nil)
Add a new row into a section; if section is nil a new section is created and added at the end of table (is section is nil a new section is created and added at the end of the table).
add(row: RowProtocol, inSectionAt index: Int?)
Add a new row into specified section (If nil is passed the last section is used as destination. if no sections are present into the table a new section with given row is created automatically).
Move/Insert/Replace Rows
Signature
Description
move(row indexPath: IndexPath, to destIndexPath: IndexPath)
Move a row in another position. This is a composed operation: first of all row is removed from source, then is added to the new path.
insert(section: Section, at index: Int)
Insert a section at specified index of the table.
replace(sectionAt index: Int, with section: Section)
Replace an existing section with the new passed.
remove(sectionAt index: Int)
Remove an existing section at specified index.
removeAll()
Remove all the sections of the table.
Get section
Signature
Description
section(atIndex idx: Int)
Return setion at specified index.
section(forID identifier: String)
Return the first section with given identifier inside the table
sections(forIDs ids: [String])
Return all sections with given identifiers
hasSection(withID identifier: String)
Return true if table contains passed section with given identifier, false otherwise
Properties
Signature
Description
isEmpty
Return true if table does not contains sections or rows
sections
Return the list of Sections actually contained into the manager (read-only)
Create a new set of Rows of the specified type which hold data for passed models (items).
Observable Events in Row
The following events are observable by the Row instance and allows you to customize behaviour and appearance of the single cell.
onDequeue: RowProtocol.RowEventCallback Message received when a cell instance has been dequeued from table.
onTap: ((RowProtocol.RowInfo) -> (RowTapBehaviour?))? Message received when user tap on a cell at specified path. You must provide a default behaviour by returning one of the RowTapBehaviour options. If nil is provided the default behaviour is deselect with animation.
onDelete: RowProtocol.RowEventCallback? Message received when a selection has been made. Selection still active only if onTap returned .keepSelection option.
onSelect: RowProtocol.RowEventCallback Message received when a selection has been made. Selection still active only ifonTap returned .keepSelection option.
onEdit: ((RowProtocol.RowInfo) -> ([UITableViewRowAction]?))? Message received when a cell at specified path is about to be swiped in order to allow on or more actions into the context. You must provide an array of UITableViewRowAction objects representing the actions for the row. Each action you provide is used to create a button that the user can tap. By default no swipe actions are returned.
onDeselect: RowProtocol.RowEventCallback? Message received when cell at specified path did deselected.
onWillDisplay: RowProtocol.RowEventCallback? Message received when a cell at specified path is about to be displayed. Gives the delegate the opportunity to modify the specified cell at the given row and column location before the browser displays it.
onDidEndDisplay: RowEventCallback? The cell was removed from the table.
onWillSelect: ((RowProtocol.RowInfo) -> (IndexPath?))? Message received when a cell at specified path is about to be selected.
onShouldHighlight: ((RowProtocol.RowInfo) -> (Bool))? Message received when a cell at specified path is about to be selected. If false is returned highlight of the cell will be disabled. If not implemented the default behaviour of the table is to allow highlights of the cell.
canMove: ((RowProtocol.RowInfo) -> (Bool))? Asks the data source whether a given row can be moved to another location in the table view. If not implemented false is assumed instead.
shouldIndentOnEditing: ((RowProtocol.RowInfo) -> (Bool))? Asks the delegate whether the background of the specified row should be indented while the table view is in editing mode. If not implemented true is returned.