Package apple.uikit

Class NSDiffableDataSourceSnapshot<_SectionIdentifierType,​_ItemIdentifierType>

  • All Implemented Interfaces:
    NSCopying, NSObject

    public class NSDiffableDataSourceSnapshot<_SectionIdentifierType,​_ItemIdentifierType>
    extends NSObject
    implements NSCopying
    A NSDiffableDataSourceSnapshot represents the complete state of a UI element (e.g. UICollectionView) Snapshots can be created in two ways: 1. From a connected data source: e.g. UICollectionViewDiffableDataSource.snapshot() This will contain the current state of the UI element. 2. Constructing a new instance: e.g. NSDiffableDataSourceSnapshot() This will construct an empty snapshot with no section or item identifiers. Notes: 1. All identifiers must be unique. Section and Item identifiers do not overlap and may contain values that exist in the other (i.e. it is OK to have a section identifier == 1 and an item identifier == 1) 2. If you pass duplicate values in an item or section array (e.g. -appendItemsWithIdentifiers:), the system will throw an exception. API-Since: 13.0
    • Constructor Detail

      • NSDiffableDataSourceSnapshot

        protected NSDiffableDataSourceSnapshot​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • appendItemsWithIdentifiers

        public void appendItemsWithIdentifiers​(@NotNull
                                               @NotNull NSArray<_ItemIdentifierType> identifiers)
        convenience: appends into last section
      • appendSectionsWithIdentifiers

        public void appendSectionsWithIdentifiers​(@NotNull
                                                  @NotNull NSArray<_SectionIdentifierType> sectionIdentifiers)
        section operations
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • deleteAllItems

        public void deleteAllItems()
      • deleteItemsWithIdentifiers

        public void deleteItemsWithIdentifiers​(@NotNull
                                               @NotNull NSArray<_ItemIdentifierType> identifiers)
      • deleteSectionsWithIdentifiers

        public void deleteSectionsWithIdentifiers​(@NotNull
                                                  @NotNull NSArray<_SectionIdentifierType> sectionIdentifiers)
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • indexOfItemIdentifier

        public long indexOfItemIdentifier​(@NotNull
                                          _ItemIdentifierType itemIdentifier)
        If item identifier is not present returns NSNotFound
      • indexOfSectionIdentifier

        public long indexOfSectionIdentifier​(@NotNull
                                             _SectionIdentifierType sectionIdentifier)
        If section identifier is not present returns NSNotFound
      • insertItemsWithIdentifiersAfterItemWithIdentifier

        public void insertItemsWithIdentifiersAfterItemWithIdentifier​(@NotNull
                                                                      @NotNull NSArray<_ItemIdentifierType> identifiers,
                                                                      @NotNull
                                                                      _ItemIdentifierType itemIdentifier)
      • insertItemsWithIdentifiersBeforeItemWithIdentifier

        public void insertItemsWithIdentifiersBeforeItemWithIdentifier​(@NotNull
                                                                       @NotNull NSArray<_ItemIdentifierType> identifiers,
                                                                       @NotNull
                                                                       _ItemIdentifierType itemIdentifier)
      • insertSectionsWithIdentifiersAfterSectionWithIdentifier

        public void insertSectionsWithIdentifiersAfterSectionWithIdentifier​(@NotNull
                                                                            @NotNull NSArray<_SectionIdentifierType> sectionIdentifiers,
                                                                            @NotNull
                                                                            _SectionIdentifierType toSectionIdentifier)
      • insertSectionsWithIdentifiersBeforeSectionWithIdentifier

        public void insertSectionsWithIdentifiersBeforeSectionWithIdentifier​(@NotNull
                                                                             @NotNull NSArray<_SectionIdentifierType> sectionIdentifiers,
                                                                             @NotNull
                                                                             _SectionIdentifierType toSectionIdentifier)
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • moveItemWithIdentifierAfterItemWithIdentifier

        public void moveItemWithIdentifierAfterItemWithIdentifier​(@NotNull
                                                                  _ItemIdentifierType fromIdentifier,
                                                                  @NotNull
                                                                  _ItemIdentifierType toIdentifier)
      • moveItemWithIdentifierBeforeItemWithIdentifier

        public void moveItemWithIdentifierBeforeItemWithIdentifier​(@NotNull
                                                                   _ItemIdentifierType fromIdentifier,
                                                                   @NotNull
                                                                   _ItemIdentifierType toIdentifier)
      • moveSectionWithIdentifierAfterSectionWithIdentifier

        public void moveSectionWithIdentifierAfterSectionWithIdentifier​(@NotNull
                                                                        _SectionIdentifierType fromSectionIdentifier,
                                                                        @NotNull
                                                                        _SectionIdentifierType toSectionIdentifier)
      • moveSectionWithIdentifierBeforeSectionWithIdentifier

        public void moveSectionWithIdentifierBeforeSectionWithIdentifier​(@NotNull
                                                                         _SectionIdentifierType fromSectionIdentifier,
                                                                         @NotNull
                                                                         _SectionIdentifierType toSectionIdentifier)
      • numberOfItems

        public long numberOfItems()
        structure
      • numberOfItemsInSection

        public long numberOfItemsInSection​(@NotNull
                                           _SectionIdentifierType sectionIdentifier)
      • numberOfSections

        public long numberOfSections()
      • reloadItemsWithIdentifiers

        public void reloadItemsWithIdentifiers​(@NotNull
                                               @NotNull NSArray<_ItemIdentifierType> identifiers)
      • reloadSectionsWithIdentifiers

        public void reloadSectionsWithIdentifiers​(@NotNull
                                                  @NotNull NSArray<_SectionIdentifierType> sectionIdentifiers)
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • reconfigureItemsWithIdentifiers

        public void reconfigureItemsWithIdentifiers​(@NotNull
                                                    @NotNull NSArray<_ItemIdentifierType> identifiers)
        Reconfigures any existing cells for the items. Reconfiguring is more efficient than reloading an item, as it does not replace the existing cell with a new cell. Prefer reconfiguring over reloading unless you actually need an entirely new cell for the item. API-Since: 15.0
      • reconfiguredItemIdentifiers

        @NotNull
        public @NotNull NSArray<_ItemIdentifierType> reconfiguredItemIdentifiers()
        API-Since: 15.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.