diff --git a/Sources/FunctionalTableData/CellActions.swift b/Sources/FunctionalTableData/CellActions.swift index bcfc23f..0a63d59 100644 --- a/Sources/FunctionalTableData/CellActions.swift +++ b/Sources/FunctionalTableData/CellActions.swift @@ -137,32 +137,32 @@ public struct CellActions { /// The action to perform when the cell will be selected. /// - Important: When the `canSelectAction` is called, it is passed a `CanSelectCallback` closure. It is the responsibility of the action to eventually call the passed in closure providing either a `true` or `false` value to it. This passed in value determines if the selection will be performed or not. - public let canSelectAction: CanSelectAction? + public var canSelectAction: CanSelectAction? /// The action to perform when the cell is selected - public let selectionAction: SelectionAction? + public var selectionAction: SelectionAction? /// The action to perform when the cell is deselected - public let deselectionAction: SelectionAction? + public var deselectionAction: SelectionAction? /// The swipe actions to display on the leading edge of the row. /// /// Use this method to return a set of actions to display when the user swipes the row. The actions you return are displayed on the leading edge of the row. For example, in a left-to-right language environment, they are displayed on the left side of the row when the user swipes from left to right. - public let leadingActionConfiguration: SwipeActionsConfiguration? + public var leadingActionConfiguration: SwipeActionsConfiguration? /// The swipe actions to display next to the trailing edge of the row. Return nil if you want the table to display the default set of actions. /// /// Use this method to return a set of actions to display when the user swipes the row. The actions you return are displayed on the trailing edge of the row. For example, in a left-to-right language environment, they are displayed on the right side of the row when the user swipes from right to left. - public let trailingActionConfiguration: SwipeActionsConfiguration? + public var trailingActionConfiguration: SwipeActionsConfiguration? /// Indicates if the cell can perform a given action. - public let canPerformAction: CanPerformAction? + public var canPerformAction: CanPerformAction? /// Indicates if the cell can be manually moved by the user. - public let canBeMoved: Bool + public var canBeMoved: Bool /// The action to perform when the cell becomes visible. - public let visibilityAction: VisibilityAction? + public var visibilityAction: VisibilityAction? /// The action to perform when the cell is 3D touched by the user. /// - note: By default the `UIViewControllerPreviewing` will have its `sourceRect` configured to be the entire cells frame. /// The given `previewingViewControllerAction` however can override this as it sees fit. - public let previewingViewControllerAction: PreviewingViewControllerAction? + public var previewingViewControllerAction: PreviewingViewControllerAction? public init( canSelectAction: CanSelectAction? = nil, diff --git a/Sources/FunctionalTableData/CellConfigType.swift b/Sources/FunctionalTableData/CellConfigType.swift index ee19879..345772a 100644 --- a/Sources/FunctionalTableData/CellConfigType.swift +++ b/Sources/FunctionalTableData/CellConfigType.swift @@ -21,7 +21,7 @@ public protocol CellConfigType: TableItemConfigType, CollectionItemConfigType { /// Indicates a cell style. See `CellStyle` for more information. var style: CellStyle? { get set } /// Indicates all the possible actions a cell can perform. See `CellActions` for more information. - var actions: CellActions { get } + var actions: CellActions { get set } /// Update the view state of a `UITableViewCell`. It is up to implementors of the protocol to determine what this means. /// diff --git a/Sources/FunctionalTableData/HostCell.swift b/Sources/FunctionalTableData/HostCell.swift index 9639b64..2524d13 100644 --- a/Sources/FunctionalTableData/HostCell.swift +++ b/Sources/FunctionalTableData/HostCell.swift @@ -16,7 +16,7 @@ public struct HostCell: CellConfigType where View: UIView, public let key: String public var style: CellStyle? - public let actions: CellActions + public var actions: CellActions /// Contains the state information of a cell. public let state: State /// A function that updates a cell's view to match the current state. It receives two values, the view instance and an optional state instance. The purpose of this function is to update the view to reflect that of the given state. The reason that the state is optional is because cells may move into the reuse queue. When this happens they no longer have a state and the updater function is called giving the opportunity to reset the view to its default value.