PickerViewManager

public final class PickerViewManager : PickerViewManagerProtocol

Manages one picker view instance. The manager creates the data source and delegate of the picker view under the hood. Columns and rows of the managing picker view can be updated.

  • Row models of the currently selected rows

    Declaration

    Swift

    public var selectedRowModels: [PickerViewRowModelProtocol]? { get }
  • Initializes the manager. The data source and delegate will be created and added to the given picker view. Finally all columns will be reloaded.

    Declaration

    Swift

    public init(setup: PickerViewSetup)

    Parameters

    setup

    setup value containing all configuration parameters

  • Selects the given row in the given column

    Declaration

    Swift

    public func selectRow(inColumn column: Int, row: Int, animated: Bool)

    Parameters

    column

    the related column

    row

    the row to select

    animated

    boolean indicating if the row selection should be animated

  • Selects the row with the given model if the row exists

    Declaration

    Swift

    public func selectRowModel(inColumn column: Int, model: PickerViewRowModelProtocol, animated: Bool)

    Parameters

    column

    the related column

    model

    the related row model

    animated

    boolean indicating if the row selection should be animated

  • Replaces the existing columns with the given columns. In preparation of the update the first row of each column will be selected. Then the data source will be updated and all columns will be reloaded.

    Declaration

    Swift

    public func updateColumns(columns: [PickerViewColumn])

    Parameters

    columns

    the new columns

  • Replaces the column at the given index with the specified column. The first row of the column will be selected before the update. Finally the data source will be updated and the column will be reloaded.

    Declaration

    Swift

    public func updateColumn(atIndex index: Int, column: PickerViewColumn)

    Parameters

    index

    specifies the index of the column

    column

    the new column

  • Updates the rows in the column at the given index with the specified rows. Selects the first row in the column, updates the rows and reloads the column at the end.

    Declaration

    Swift

    public func updateRows(inColumn column: Int, rows: [PickerViewRowProtocol])

    Parameters

    column

    specifies the index of the column

    rows

    the new rows