NSCollectionView

class NSCollectionView : NSView, NSDraggingSource, NSDraggingDestination
  • Animates items which changed between oldData and newData.

    Declaration

    Swift

    public func animateItemChanges<T: Collection>(
        oldData: T,
        newData: T,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 },
        completion: ((Bool) -> Void)? = nil
        ) where T.Element: Equatable

    Parameters

    oldData

    Data which reflects the previous state of UICollectionView

    newData

    Data which reflects the current state of UICollectionView

    indexPathTransform

    Closure which transforms zero-based IndexPath to desired IndexPath

    completion

    Closure to be executed when the animation completes

  • Animates items which changed between oldData and newData.

    Declaration

    Swift

    public func animateItemChanges<T: Collection>(
        oldData: T,
        newData: T,
        isEqual: EqualityChecker<T>,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 },
        completion: ((Bool) -> Swift.Void)? = nil
        )

    Parameters

    oldData

    Data which reflects the previous state of UICollectionView

    newData

    Data which reflects the current state of UICollectionView

    isEqual

    A function comparing two elements of T

    indexPathTransform

    Closure which transforms zero-based IndexPath to desired IndexPath

    completion

    Closure to be executed when the animation completes

  • Undocumented

    Declaration

    Swift

    public func apply(
        _ diff: ExtendedDiff,
        completion: ((Bool) -> Swift.Void)? = nil,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 }
        )
  • Animates items and sections which changed between oldData and newData.

    Declaration

    Swift

    public func animateItemAndSectionChanges<T: Collection>(
        oldData: T,
        newData: T,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 },
        sectionTransform: @escaping (Int) -> Int = { $0 },
        completion: ((Bool) -> Swift.Void)? = nil
        )
        where T.Element: Collection,
        T.Element: Equatable,
        T.Element.Element: Equatable

    Parameters

    oldData

    Data which reflects the previous state of UICollectionView

    newData

    Data which reflects the current state of UICollectionView

    indexPathTransform

    Closure which transforms zero-based IndexPath to desired IndexPath

    sectionTransform

    Closure which transforms zero-based section(Int) into desired section(Int)

    completion

    Closure to be executed when the animation completes

  • Animates items and sections which changed between oldData and newData.

    Declaration

    Swift

    public func animateItemAndSectionChanges<T: Collection>(
        oldData: T,
        newData: T,
        isEqualElement: NestedElementEqualityChecker<T>,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 },
        sectionTransform: @escaping (Int) -> Int = { $0 },
        completion: ((Bool) -> Swift.Void)? = nil
        )
        where T.Element: Collection,
        T.Element: Equatable

    Parameters

    oldData

    Data which reflects the previous state of UICollectionView

    newData

    Data which reflects the current state of UICollectionView

    isEqualElement

    A function comparing two items (elements of T.Element)

    indexPathTransform

    Closure which transforms zero-based IndexPath to desired IndexPath

    sectionTransform

    Closure which transforms zero-based section(Int) into desired section(Int)

    completion

    Closure to be executed when the animation completes

  • Animates items and sections which changed between oldData and newData.

    Declaration

    Swift

    public func animateItemAndSectionChanges<T: Collection>(
        oldData: T,
        newData: T,
        isEqualSection: EqualityChecker<T>,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 },
        sectionTransform: @escaping (Int) -> Int = { $0 },
        completion: ((Bool) -> Swift.Void)? = nil
        )
        where T.Element: Collection,
        T.Element.Element: Equatable

    Parameters

    oldData

    Data which reflects the previous state of UICollectionView

    newData

    Data which reflects the current state of UICollectionView

    isEqualSection

    A function comparing two sections (elements of T)

    indexPathTransform

    Closure which transforms zero-based IndexPath to desired IndexPath

    sectionTransform

    Closure which transforms zero-based section(Int) into desired section(Int)

    completion

    Closure to be executed when the animation completes

  • Animates items and sections which changed between oldData and newData.

    Declaration

    Swift

    public func animateItemAndSectionChanges<T: Collection>(
        oldData: T,
        newData: T,
        isEqualSection: EqualityChecker<T>,
        isEqualElement: NestedElementEqualityChecker<T>,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 },
        sectionTransform: @escaping (Int) -> Int = { $0 },
        completion: ((Bool) -> Swift.Void)? = nil
        )
        where T.Element: Collection

    Parameters

    oldData

    Data which reflects the previous state of UICollectionView

    newData

    Data which reflects the current state of UICollectionView

    isEqualSection

    A function comparing two sections (elements of T)

    isEqualElement

    A function comparing two items (elements of T.Element)

    indexPathTransform

    Closure which transforms zero-based IndexPath to desired IndexPath

    sectionTransform

    Closure which transforms zero-based section(Int) into desired section(Int)

    completion

    Closure to be executed when the animation completes

  • Undocumented

    Declaration

    Swift

    public func apply(
        _ diff: NestedExtendedDiff,
        indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 },
        sectionTransform: @escaping (Int) -> Int = { $0 },
        completion: ((Bool) -> Void)? = nil
        )