ArrayDataProviderModifier
public final class ArrayDataProviderModifier<Element> : DataModifying
Wrapps an ArrayDataProvider and handles changes to manipulate the content of the provider.
Seealso
DataModifying
-
Flag if items can be moved by the data source.
Declaration
Swift
public var canMoveItems: Bool -
Flag if items can be edited by the data source.
Declaration
Swift
public var canEditItems: Bool -
Creates an
ArrayDataProviderinstance.Declaration
Swift
public init(dataProvider: ArrayDataProvider<Element>, canMoveItems: Bool = false, canEditItems: Bool = false, createElement: (() -> Element)? = nil)Parameters
dataProviderthe data provider which should be modifiable
canMoveItemsFlag if items can be moved by the data source.
canEditItemsFlag if items can be edited by the data source.
-
Checks whether item at an indexPath can be moved
Declaration
Swift
public func canMoveItem(at indexPath: IndexPath) -> BoolParameters
indexPaththe indexPath to check for if it can be moved
Return Value
if the item can be moved
-
Moves item from sourceIndexPath to destinationIndexPath
Declaration
Swift
public func moveItemAt(sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath, updateView: Bool = true)Parameters
sourceIndexPathSource’s IndexPath
destinationIndexPathDestination’s IndexPath
updateViewdetermines if the view should be updated. Pass
falseif someone else take care of updating the change into the view -
Checks wethere item at an indexPath can be edited
Declaration
Swift
public func canEditItem(at indexPath: IndexPath) -> BoolParameters
indexPaththe indexPath to check for if it can be edited
Return Value
if the item can be edited
-
Deleted item at a given indexPath
Declaration
Swift
public func deleteItem(at indexPath: IndexPath)Parameters
indexPaththe indexPath to delete
-
Inserts an element at given indexPath
Declaration
Swift
public func insertItem(at indexPath: IndexPath)
View on GitHub
ArrayDataProviderModifier Class Reference