18#import <Foundation/Foundation.h>
19#import <StoreKit/StoreKit.h>
24NS_ASSUME_NONNULL_BEGIN
36@protocol StorePackListDelegate <NSObject>
44 errorMessage:(nullable NSString *)errorMessage;
52 isInitial:(BOOL)isInitial
114- (void)addGenres:(nullable NSArray *)genreList;
123- (void)addGenres:(nullable NSArray *)genreList extendList:(nullable NSDictionary *)extendList;
131- (void)addPromotions:(nullable NSArray *)promotionList
132 validProducts:(nullable NSArray<SKProduct *> *)validProducts;
149- (int)genreIndexForgenreID:(NSInteger)genreID;
172- (void)startFetchForGenreID:(NSUInteger)genreID;
179- (void)startFetchForGenreIndex:(NSUInteger)genreIndex;
193- (void)startFetchAdditionalPack:(nullable NSNumber *)packID;
207@property(nonatomic, readonly) BOOL
isFetching;
225@property(nonatomic, weak, nullable) id<StorePackListDelegate>
delegate;
One purchasable pack in the store.
A pack's identity, name, price, store flags, and track list.
Definition StorePackInfo.h:18
Fetches, groups, and vends the store's genre and pack lists.
Definition StorePackListController.h:71
BOOL initiallyLoaded
Whether the genre and promotion lists have been loaded at least once.
Definition StorePackListController.h:213
NSArray< NSString * > * genreNames()
The display names of the held genres, in order.
Definition StorePackListController.m:122
void cancelFetching()
Cancels any in-flight download or product request and clears the pending additional pack.
Definition StorePackListController.m:349
instancetype init()
Builds an empty controller seeded with a single "all" genre.
Definition StorePackListController.m:97
id< StorePackListDelegate > delegate
The download-outcome delegate.
Definition StorePackListController.h:225
NSArray< StorePackListGenre * > * genreInfos()
A copy of the held genre models, in order.
Definition StorePackListController.m:134
nullable NSArray< StorePromotion * > * promotions()
The most recently built promotion list.
Definition StorePackListController.m:301
nullable NSString * storeCountry()
The App Store country recorded from the most recent product's price locale.
Definition StorePackListController.m:87
NSNumber * additionalPackID
The pending additional-pack identifier, held for the duration of its StoreKit request.
Definition StorePackListController.h:219
BOOL isFetching
Whether a download or product request is currently in flight.
Definition StorePackListController.m:362
NSUInteger numGenres()
The number of genres currently held.
Definition StorePackListController.m:117
A store model for a single pack-list genre.
Definition StorePackListGenre.h:25
Performs a single HTTP request.
Definition Downloader.h:30