VOWrappingPaperManagerProtocol
@protocol VOWrappingPaperManagerProtocol
VOWrappingPaperManagerProtocol
is the interface for retrieving VOWrappingPaperMedia
s from the Vouchr Server.
-
Requests
VOWrappingPaperCategory
s from the Vouchr Server.Declaration
Objective-C
- (void)requestWrappingPaperCategories: (nullable void (^)(NSArray<VOWrappingPaperCategory *> *_Nonnull)) onSuccess error:(nullable void (^)(NSError *_Nullable)) onError;
Swift
func requestWrappingPaperCategories(_ onSuccess: ((Int32) -> Void)?, error onError: ((UnsafeMutablePointer<Int32>?) -> Void)? = nil)
Parameters
onSuccess
- block to be executed upon successful retrieval of
VOWrappingPaperCategory
s.onError
- error block if the wrapping papers were not retrieved successfully.
-
Retrieves a random
VOWrappingPaperMedia
. If there areVOWrappingPaperMedia
s already cached, a random paper from that list will be returned. Otherwise, a network request will be performed.Declaration
Objective-C
- (void)getRandomWrappingPaperWithCompletion: (nonnull void (^)(VOWrappingPaperMedia *_Nonnull))completed;
Swift
func getRandomWrappingPaper(completion completed: ((VOWrappingPaperMedia?) -> Void)!)
Parameters
completed
- completion block with the random
VOWrappingPaperMedia
- A defaultVOWrappingPaperMedia
if an error occurred.