// // PHFetchResult.h // Photos // // Copyright (c) 2013 Apple Inc. All rights reserved. // #import #import NS_ASSUME_NONNULL_BEGIN API_AVAILABLE_BEGIN(macos(10.13), ios(8), tvos(10)) // Accessing fetched results (fetches objects from the backing store in chunks on demand rather than all at once) // Fetched objects will be kept in a cache and purged under memory pressure OS_EXPORT @interface PHFetchResult<__covariant ObjectType> : NSObject @property (readonly) NSUInteger count; - (ObjectType)objectAtIndex:(NSUInteger)index; - (ObjectType)objectAtIndexedSubscript:(NSUInteger)idx; - (BOOL)containsObject:(ObjectType)anObject; - (NSUInteger)indexOfObject:(ObjectType)anObject; - (NSUInteger)indexOfObject:(ObjectType)anObject inRange:(NSRange)range; @property (nonatomic, readonly, nullable) ObjectType firstObject; @property (nonatomic, readonly, nullable) ObjectType lastObject; - (NSArray *)objectsAtIndexes:(NSIndexSet *)indexes; - (void)enumerateObjectsUsingBlock:(void (^)(ObjectType obj, NSUInteger idx, BOOL *stop))block; - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(ObjectType obj, NSUInteger idx, BOOL *stop))block; - (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void (^)(ObjectType obj, NSUInteger idx, BOOL *stop))block; - (NSUInteger)countOfAssetsWithMediaType:(PHAssetMediaType)mediaType; @end API_AVAILABLE_END NS_ASSUME_NONNULL_END