DialogListViewController
class DialogListViewController<T> : DialogViewController where T : StaticTableItem
Generic dialog with a list of items with (multi-)selection option.
-
Creates a
DialogListViewController
with a list of items of typeT
and other parameters.Note
Item element should conform to
StaticTableItem
.Declaration
Swift
init(list: [T], title: String, selectionType: StaticTableViewSelectionType = .single, color: UIColor = .systemBlue, completion: @escaping (SelectedRows) -> Bool)
Parameters
list
Underlying list of elements of base type
StaticTableItem
for this instance.title
Title of the dialog.
selectionType
StaticTableViewSelectionType
to be used to setup the selection type.color
Accent color of the dialog.
completion
Completion handler with the selected index of elements. If it’s empty then the dialog was cancelled.