Classes

The following classes are available globally.

  • An image view for displaying animated image.

    @discussion It is a fully compatible UIImageView subclass. If the image or highlightedImage property adopt to the YYAnimatedImage protocol, then it can be used to play the multi-frame animation. The animation can also be controlled with the UIImageView methods -startAnimating, -stopAnimating and -isAnimating.

    This view request the frame data just in time. When the device has enough free memory, this view may cache some or all future frames in an inner buffer for lower CPU cost. Buffer size is dynamically adjusted based on the current state of the device memory.

    Sample Code:

    // [email protected]
    YYImage *image = [YYImage imageNamed:@"ani"];
    YYAnimatedImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image];
    [view addSubView:imageView];
    
    See more

    Declaration

    Objective-C

    @interface YYAnimatedImageView : UIImageView

    Swift

    class YYAnimatedImageView : UIImageView
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NetworkManager : NSObject <VONetworkManagerProtocol>
    
    + (instancetype)networkManagerWithBuilder:(void (^)(NetworkManagerBuilder *))builderBlock;
    
    @end

    Swift

    class NetworkManager : NSObject, VONetworkManagerProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NetworkManagerBuilder : NSObject
    
    @property (nonatomic) NSURLSessionConfiguration *sessionConfiguration;
    @property (nonatomic) NSURL *baseUrl;
    @property (nonatomic) NSString *sdkString;
    
    
    @end

    Swift

    class NetworkManagerBuilder : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface UserManager : NSObject <VOUserManagerProtocol>
    
    // anytime a user is updated (saved to cache) this signal will be signaled with the new user
    @property (nonatomic, readonly) RACSignal *userUpdatedSignal;
    // anytime friends is updated (saved to cache) this signal will be signaled with the list of friends
    @property (nonatomic, readonly) RACSignal *friendsUpdatedSignal;
    // anytime a user logs in this signal will be signaled with the logged in user
    @property (nonatomic, readonly) RACSignal *loginSignal;
    // anytime a user logs out this signal will be signaled
    @property (nonatomic, readonly) RACSignal *logoutSignal;
    
    
    // Default initializer
    // if cacheProtocol object is nil nothing will ever be cached
    // if networkManager is nil nothing will be ever sent to server (this is bad)
    // if persistManager is nil tokens will not be persisted, and the user will be logged out on each app startup
    - (instancetype)initWithCacheManager:(id<VOCacheProtocol>)cacheManager
                          networkManager:(id<VONetworkManagerProtocol>)networkManager
                          persistManager:(id<VOPersistManagerProtocol>)persistManager;
    
    // TODO: add config to initializer.. or make a builder?!
    
    @end

    Swift

    class UserManager : NSObject, VOUserManagerProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ActivityFeedVoucher : NSObject
    
    @property (nonatomic, readonly) long long voucherId;
    @property (nonatomic, strong, readonly) NSString *title;
    @property (nonatomic, readonly) User *owner;
    @property (nonatomic, strong, readonly) User *mostRecentCommentUser;
    @property (nonatomic, readonly) long long mostRecentTimeStamp;
    @property (nonatomic, readonly) NSString *mostRecentComment;
    @property (nonatomic, readonly) BOOL mostRecentCommentRead;
    
    @property (nonatomic, strong, readonly) NSString *bannerUrl;
    @property (nonatomic, strong, readonly) NSString *bannerColorHexString;
    
    @property (nonatomic, readonly) long long claimerId;
    @property (nonatomic, readonly) long long claimDateTimeStamp;
    
    // TODO: status & game stuff
    
    + (ActivityFeedVoucher *)activityFeedVoucherFromDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class ActivityFeedVoucher : NSObject
  • Credential is used to pass credentials to the VouchrServer when logging in and authenticating users.

    See more

    Declaration

    Objective-C

    @interface Credential : NSObject

    Swift

    class Credential : NSObject
  • GameData contains all the data for a game / challenge. It contains data that will stay static (eg. the title of the game), and data that will change based on which Voucher it is in (eg. scoreToWin).

    See more

    Declaration

    Objective-C

    @interface GameData : NSObject

    Swift

    class GameData : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface GameDifficulty : NSObject
    
    @property (strong, nonatomic, readonly) NSString *name;
    @property (nonatomic, readonly) GameDifficultyLevel difficultyLevel;
    @property (nonatomic, readonly) NSInteger minimumScore;
    
    + (GameDifficulty *)gameDifficultyFromDictionary:(NSDictionary *)dictionary;
    + (NSString*)stringFromDifficultyLevel:(GameDifficultyLevel)difficulty;
    + (GameDifficultyLevel)difficultyLevelFromString:(NSString *)difficulty;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class GameDifficulty : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ImageModel : NSObject <NSCoding>
    
    @property (nonatomic, readonly, nullable) NSString *imageUrl;
    @property (nonatomic, nullable) NSData *imageData;
    @property (nonatomic, readonly) BOOL animated;
    @property (nonatomic, readonly) float imageWidth;
    @property (nonatomic, readonly) float imageHeight;
    @property (nonatomic, readonly, nullable) NSString *thumbnailUrl;
    
    + (nonnull ImageModel *)imageModelWithImageUrl:(nonnull NSString *)imageUrl
                                          animated:(BOOL)animated
                                             width:(float)imageWidth
                                            height:(float)imageHeight
                                      thumbnailUrl:(nullable NSString *)thumbnailUrl;
    
    + (nonnull ImageModel *)imageModelWithImageData:(nonnull NSData *)imageData
                                           animated:(BOOL)animated
                                              width:(float)imageWidth
                                             height:(float)imageHeight
                                       thumbnailUrl:(nullable NSString *)thumbnailUrl;
    
    + (nonnull ImageModel *)imageModelFromDictionary:(nonnull NSDictionary *)dictionary;
    
    - (nonnull NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class ImageModel : NSObject, NSCoding
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface Merchant : NSObject <NSCoding>
    
    @property (nonatomic, readonly) long long merchantId;
    @property (nonatomic, readonly) NSString *merchantUri;
    @property (nonatomic, readonly) NSString *name;
    @property (nonatomic, readonly) NSString *photoUrl;
    @property (nonatomic, readonly) NSString *previewPhotoUrl;
    @property (nonatomic, readonly) NSString *backgroundColorHexString;
    
    @property (nonatomic, assign, readonly) BOOL hasOnlinePurchases;
    @property (nonatomic, assign, readonly) BOOL hasCashPurchases;
    @property (nonatomic, assign, readonly) BOOL productSearchEnabled;
    
    @property (nonatomic, readonly) NSArray<PaymentMerchantInfo *> *paymentMerchantInfos;
    @property (nonatomic, readonly) PaymentMerchantInfo *sourceInfo;
    @property (nonatomic, readonly) NSString *websiteUrl;
    
    @property (nonatomic, readonly) NSString *featuredBackgroundImageUrl;
    @property (nonatomic, readonly) NSString *featuredButtonImageUrl;
    @property (nonatomic, readonly) NSString *featuredHeading;
    @property (nonatomic, readonly) NSString *featuredSubheading;
    @property (nonatomic, readonly) NSString *action;
    
    + (Merchant *)merchantFromDictionary:(NSDictionary *)dictionary;
    - (instancetype)initWithDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class Merchant : NSObject, NSCoding
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface MerchantProduct : NSObject
    
    @property (nonatomic, strong, readonly) NSString *code;
    @property (nonatomic, readonly) double price;
    @property (nonatomic, strong, readonly) NSString *label;
    @property (nonatomic, readonly) double fee;
    
    + (MerchantProduct *)productWithDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class MerchantProduct : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface MutableVoucher : Voucher
    
    @property (nonatomic) long long vId;
    @property (nonatomic) VoucherStatus status;
    
    // Merchant properties
    @property (nonatomic) Merchant *merchant;
    @property (nonatomic) double amount;
    @property (nonatomic) double fee;
    @property (nonatomic, strong) NSString *currency;
    
    // Thank you photo
    @property (nonatomic) BOOL isThankYouPhotoRequired;
    @property (nonatomic) NSDate *thankYouDate;
    
    // dates
    @property (nonatomic, strong) NSDate *dateModified;
    @property (nonatomic, strong) NSDate *dateCreated;
    @property (nonatomic, strong) NSDate *dateClaimable;
    
    // Users
    @property (nonatomic, strong) User *creator;
    @property (nonatomic, strong) User *claimer;
    @property (nonatomic, strong) NSArray <User *> *viewers;
    @property (nonatomic, strong) NSArray <User *> *recipients;
    @property (nonatomic, strong) NSArray <NSNumber *> *unwrappedUsers;
    
    // customization options
    @property (nonatomic, strong) NSString *title;
    @property (nonatomic, strong) NSString *shareImageUrl;
    @property (nonatomic) VoucherPrivacyStatus privacy;
    @property (nonatomic, strong) NSArray <VoucherMedia *> *medias;
    @property (nonatomic, strong) WrappingPaper *wrappingPaper;
    @property (nonatomic, strong) GameData *gameData;
    
    - (instancetype)initWithDictionary:(NSDictionary *)dictionary;
    
    + (instancetype)mutableVoucherWithDictionary:(NSDictionary *)dictionary;
    + (instancetype)mutableVoucherWithVoucher:(Voucher *)voucher;
    
    - (void)addMedia:(VoucherMedia *)media;
    - (void)removeMedia:(VoucherMedia *)media;
    
    @end

    Swift

    class MutableVoucher : Voucher
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PaymentInfo : NSObject
    
    @property (nonatomic, readonly) PaymentInfoType type;
    @property (nonatomic, strong, readonly) NSString *paymentId;
    @property (nonatomic, strong, readonly) NSDictionary *voucherInfo;
    @property (nonatomic, strong, readonly) NSDictionary *userInfo;
    @property (nonatomic, strong, readonly) NSDictionary *merchantInfo;
    
    + (PaymentInfo *)paymentInfoFromDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class PaymentInfo : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PaymentMerchantInfo : NSObject
    
    @property (nonatomic, readonly) PaymentMerchantInfoType type;
    @property (nonatomic, strong, readonly) NSString *name;
    @property (nonatomic, strong, readonly) NSString *photoUrl;
    @property (nonatomic, strong, readonly) NSString *externalId;
    @property (nonatomic, strong, readonly) NSArray<NSString*> *currencies;
    @property (nonatomic, strong, readonly) NSString *giftCardPreviewImageUrl;
    @property (nonatomic, strong, readonly) NSString *paymentMerchantInfoDescription;
    @property (nonatomic, readonly) BOOL mustPrintToRedeem;
    @property (nonatomic, readonly) double minValue;
    @property (nonatomic, readonly) double maxValue;
    @property (nonatomic, strong, readonly) NSArray<MerchantProduct *> *fixedProducts;
    
    // properties
    @property (nonatomic, strong, readonly) NSString *brandId;
    @property (nonatomic, strong, readonly) NSString *legalDisclaimer;
    @property (nonatomic, strong, readonly) NSString *termsAndConditions;
    @property (nonatomic, strong, readonly) NSString *cardHolderAgreementUrlString;
    
    + (PaymentMerchantInfo *)paymentMerchantInfoFromDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class PaymentMerchantInfo : NSObject
  • User model for the VouchrSDK. Users are used to identify the logged in user and typically gifts are sent to a User(s).

    See more

    Declaration

    Objective-C

    @interface User : NSObject <NSCoding, NSCopying>

    Swift

    class User : NSObject, NSCoding, NSCopying
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface UserNetwork : NSObject
    
    @property (nonatomic, strong, readonly) NSString *name;
    @property (nonatomic, strong, readonly) NSString *externalUserName;
    @property (nonatomic, strong, readonly) NSString *externalUserId;
    @property (nonatomic, strong, readonly) NSString *accessToken;
    @property (nonatomic, readonly) UserNetworkStatus status;
    
    + (instancetype)userNetworkFromDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class UserNetwork : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface Voucher : NSObject <NSCoding>
    
    @property (nonatomic, readonly) long long vId;
    @property (nonatomic, readonly) VoucherStatus status;
    
    // Merchant properties
    @property (nonatomic, readonly) double amount;
    @property (nonatomic, readonly) double fee;
    @property (nonatomic, readonly) NSString *currency;
    @property (nonatomic, readonly) Merchant *merchant;
    
    // payment
    @property (nonatomic, readonly) VoucherPayment *paymentInfo;
    
    // Thank you photo
    @property (nonatomic, readonly) BOOL isThankYouPhotoRequired;
    @property (nonatomic, readonly) NSDate *thankYouDate;
    
    // dates
    @property (nonatomic, readonly) NSDate *dateModified;
    @property (nonatomic, readonly) NSDate *dateCreated;
    @property (nonatomic, readonly) NSDate *dateClaimable;
    
    
    // Users
    @property (nonatomic, readonly) User *creator;
    @property (nonatomic, readonly) User *claimer;
    @property (nonatomic, readonly) NSArray <User *> *viewers;
    @property (nonatomic, readonly) NSArray <User *> *recipients;
    @property (nonatomic, readonly) NSArray <NSNumber *> *unwrappedUsers;
    
    // customization options
    @property (nonatomic, readonly) NSString *title;
    @property (nonatomic, readonly) NSString *shareImageUrl;
    @property (nonatomic, readonly) VoucherPrivacyStatus privacy;
    @property (nonatomic, readonly) NSArray <VoucherMedia *> *medias;
    @property (nonatomic, readonly) WrappingPaper *wrappingPaper;
    @property (nonatomic, readonly) GameData *gameData;
    
    - (instancetype)initWithDictionary:(NSDictionary *)dictionary;
    + (instancetype)voucherWithDictionary:(NSDictionary *)dictionary;
    
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class Voucher : NSObject, NSCoding
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface VoucherMedia : NSObject
    
    @property (nonatomic, readonly) VoucherMediaType mediaType;
    @property (nonatomic) long mediaId;
    @property (strong, nonatomic, readonly) NSString *title;
    @property (strong, nonatomic) NSString *mediaUrlString;
    @property (strong, nonatomic) NSString *thumbnailUrlString;
    @property (nonatomic, readonly) long long userId;
    @property (nonatomic, readonly) long displayOrder;
    
    - (instancetype)initWithDictionary:(NSDictionary *)dictionary;
    - (instancetype)initWithType:(VoucherMediaType)mediaType
                           title:(NSString *)title
                  mediaUrlString:(NSString *)mediaUrlString
              thumbnailUrlString:(NSString *)thumbnailUrlString;
    
    + (NSArray<VoucherMedia *>*)voucherMediasFromArray:(NSArray *)mediasJson;
    + (instancetype)voucherMediaWithDictionary:(NSDictionary *)dictionary;
    + (instancetype)voucherMediaWithType:(VoucherMediaType)mediaType
                                   title:(NSString *)title
                          mediaUrlString:(NSString *)mediaUrlString
                      thumbnailUrlString:(NSString *)thumbnailUrlString;
    
    - (NSDictionary *)dictionaryRepresentation;
    
    - (void)setMediaUrlString:(NSString *)mediaUrlString;
    - (void)setThumbnailUrlString:(NSString *)thumbnailUrlString;
    
    + (NSString *)mediaStringFromMediaType:(VoucherMediaType)mediaType;
    
    - (void)updateWithMedia:(VoucherMedia *)media;
    
    @end

    Swift

    class VoucherMedia : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface VoucherPayment : NSObject
    
    @property (nonatomic, assign, readonly) BOOL success;
    @property (nonatomic, assign, readonly) PaymentInfoErrorSource errorSource;
    @property (nonatomic, assign, readonly) PaymentInfoErrorState errorState;
    @property (nonatomic, assign, readonly) NSInteger paymentErrorDetailsCode;
    @property (nonatomic, strong, readonly) NSString *paymentErrorDetailsMessage;
    
    @property (nonatomic, assign, readonly) PaymentInfoState paymentState;
    
    @property (nonatomic, strong, readonly) PaymentInfo *sourceInfo;
    @property (nonatomic, strong, readonly) PaymentInfo *destInfo;
    @property (nonatomic, strong, readonly) PaymentInfo *redeemInfo;
    
    @property (nonatomic, strong, readonly) NSArray *paymentSourceOptions;
    @property (nonatomic, strong, readonly) NSArray *paymentDestOptions;
    
    @property (nonatomic, assign, readonly) BOOL requiresIntervention;
    
    + (VoucherPayment *)voucherPaymentFromDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class VoucherPayment : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface VouchrError : NSObject
    
    @property (nonatomic, strong, readonly) NSMutableDictionary *data;
    @property (nonatomic, readonly) int code;
    
    
    - (id)initWithDictionary:(NSDictionary *)dictionary;
    - (id)initWithCode:(int)code;
    + (VouchrError *)errorWithDictionary:(NSDictionary *)dictionary;
    
    - (NSString *)message;
    - (NSArray<NSDictionary *> *)errorFields;
    
    @end

    Swift

    class VouchrError : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface WrappingPaper : NSObject
    
    @property (nonatomic, readonly) ImageModel *imageModel;
    @property (nonatomic) NSString *wrappingRibbonColorHex;
    @property (nonatomic) NSString *wrappingRibbonColorHex2;
    @property (nonatomic, readonly) NSString *categoryId;
    @property (nonatomic) NSString *title;
    @property (nonatomic) NSString *searchText;
    
    + (WrappingPaper *)wrappingPaperFromDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    @end

    Swift

    class WrappingPaper : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface WrappingPaperCategory : NSObject
    
    @property (strong, nonatomic) NSArray <WrappingPaper *> *wrappingPapers;
    @property (strong, nonatomic) NSArray <ImageModel *> *imageResults;
    @property (strong, nonatomic, readonly) NSString *title;
    @property (strong, nonatomic, readonly) NSString *searchText;
    @property (strong, nonatomic, readonly) NSString *imageUrl;
    @property (strong, nonatomic, readonly) NSString *roundImageUrl;
    @property (nonatomic, readonly) WrappingPaperCategoryType type;
    @property (nonatomic, readonly) NSInteger order;
    @property (strong, nonatomic, readonly) NSString *categoryId;
    
    + (instancetype)wrappingPaperCategoryFromDictionary:(NSDictionary *)dictionary;
    - (NSDictionary *)dictionaryRepresentation;
    
    - (id)getObjectAtIndex:(NSInteger)index;
    
    @end

    Swift

    class WrappingPaperCategory : NSObject
  • VouchrConfig is the global config for the VouchrSDK.

    Note

    serverUrl and sdkString must be set or the application will throw an exception when the VouchrEngine is built.

    These properties can be implemented in code or by plist.

    By Code: Use config initializer and set the properties manually before passing it to the VouchrEngine.

    By Plist: Add VouchrConfig.plist and use the defaultConfig initializer or add .plist and use the configWithContentsOfFile:<path_to_plist> initializer

    See more

    Declaration

    Objective-C

    @interface VouchrConfig : NSObject

    Swift

    class VouchrConfig : NSObject
  • VouchrEngine is a singleton that persists and provides access to core manager dependencies.

    Usage Notes

    Initialize the VouchrEngine using the vouchrEngineWithBuilder: method. Example:

    VouchrEngine *vouchrEngine = [VouchrEngine vouchrEngineWithBuilder:^(VouchrEngineBuilder *builder) { builder.cacheManager = [CacheManager new]; builder.networkManager = [NetworkManager new]; builder.userManager = [[UserManager alloc] initWithCacheManager:builder.cacheManager networkManager:builder.networkManager persistManager:nil]; }];

    See more

    Declaration

    Objective-C

    @interface VouchrEngine : NSObject

    Swift

    class VouchrEngine : NSObject
  • VouchrEngineBuilder is used only to help construct the VouchrEngine and should not be initialized directly.

    See more

    Declaration

    Objective-C

    @interface VouchrEngineBuilder : NSObject

    Swift

    class VouchrEngineBuilder : NSObject
  • SealedVoucherView is a sealed EnvelopeView. It shows ribbons and a seal overtop of an EnvelopeView.

    See more

    Declaration

    Objective-C

    @interface SealedVoucherView : UIView

    Swift

    class SealedVoucherView : UIView
  • VouchrWebImage is a convenience view that is capable of asynchronously downloading images. During download of the image, the view will shimmer, resembling a loading state. This view does not subclass UIImageView but can be used in place of one, as it follows a similar protocol.

    See more

    Declaration

    Objective-C

    @interface VouchrWebImageView : FBShimmeringView

    Swift

    class VouchrWebImageView : FBShimmeringView
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AddNoteViewController : UIViewController
    
    /**
     Default instantiation method for `AddNoteViewController`
     @param personalizationOption - contains the configuration options for the note creation
     @param creationManager - the manager responsible for handling the flow management in the creation process.
     @param delegate - the object responsible for implementing CreateddTitleViewController callbacks
     @return an instance of CreateAddTitleViewController
     **/
    + (instancetype)viewControllerWithPersonalizationOption:(PersonalizationOption *)personalizationOption
                                                      notes:(NSArray<NoteMedia *> *)notes
                                            creationManager:(VoucherCreationManager *)creationManager
                                                   delegate:(id<AddNoteViewControllerDelegate>)delegate;
    
    // TODO: RB - figure out what this does lol
    //- (void)setOriginatingImageView:(UIView *)imageView;
    
    @end

    Swift

    class AddNoteViewController : UIViewController
  • PersonalizationOption represents a Voucher customization which will be available to the user in the VoucherCreationViewController. A PersonalizationOption should exist for each personalization the user allowed access to.

    Note

    PersonalizationOption is used as a base class, instantiate an existing subclass (ex. PhotoPersonalizationOption) for use.

    Note

    Any properties that are not set will have default values set.
    See more

    Declaration

    Objective-C

    @interface PersonalizationOption : NSObject

    Swift

    class PersonalizationOption : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PersonalizationOptionBuilder : NSObject
    
    @property (nonatomic) PersonalizationType type;
    @property (nonatomic) BOOL canAddMultiple;
    @property (strong, nonatomic) VouchrTheme *vouchrTheme;
    
    // carousel properties
    @property (nonatomic, strong) UIImage *carouselImage;
    @property (nonatomic, strong) NSString *carouselText;
    @property (nonatomic, strong) NSString *carouselOverlappingText;
    @property (nonatomic, strong) UIColor *carouselBackgroundColor;
    
    @end

    Swift

    class PersonalizationOptionBuilder : NSObject
  • GoogleImageSearchAgent follows the SearchAgent protocol to get image’s from Google Custom Search. In increments of 10, it will return 100 or less images on a successful search, depending on the maxSearchResult property of the PhotoPersonalizationOption. It searches with safeSearch set to high. *

    See more

    Declaration

    Objective-C

    @interface GoogleImageSearchAgent : NSObject <SearchAgent>

    Swift

    class GoogleImageSearchAgent : NSObject, SearchAgent
  • PhotoPersonalizationOption represents a Voucher customization that allows the user to add images to their Voucher. Instantiate a PhotoPersonalizationOption and include it in the VoucherCreationViewController setup if you would like the user to be able to add photos. *

    See more

    Declaration

    Objective-C

    @interface PhotoPersonalizationOption : PersonalizationOption

    Swift

    class PhotoPersonalizationOption : PersonalizationOption
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PhotoPersonalizationOptionBuilder : PersonalizationOptionBuilder
    
    @property (nonatomic) BOOL allowPhotoEditing;
    @property (nonatomic) BOOL canUploadPhotos;
    @property (nonatomic) BOOL canTakePhotos;
    @property (nonatomic) BOOL canAddGoogleImages;
    
    @property (nonatomic, strong) VouchrTheme *takeAPhotoVouchrTheme;
    @property (nonatomic, strong) VouchrTheme *imageSelectorVouchrTheme;
    @property (nonatomic, strong) VouchrTheme *editImageVouchrTheme;
    
    @property (nonatomic, strong) NSArray <UIColor *> *imageBackgroundColors;
    @property (nonatomic, strong) NSArray <NSString *> *suggestedSearchTerms;
    @property (nonatomic) NSInteger maxSearchResults;
    @property (nonatomic) BOOL allowUserCustomSearch;
    
    @end

    Swift

    class PhotoPersonalizationOptionBuilder : PersonalizationOptionBuilder
  • RecipientPersonalizationOption represents a Voucher customization which will be available to the user to add a recipient to the MutableVoucher. Instantiate a RecipientPersonalizationOption if you would like the user to be able to add a recipient to their Voucher. *

    See more

    Declaration

    Objective-C

    @interface RecipientPersonalizationOption : PersonalizationOption

    Swift

    class RecipientPersonalizationOption : PersonalizationOption
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface RecipientPersonalizationOptionBuilder : PersonalizationOptionBuilder
    
    @property (nonatomic) BOOL canMakeItARace;
    @property (nonatomic) BOOL canChangeUnwrapDate;
    @property (nonatomic) BOOL canSendToEmail;
    @property (nonatomic) BOOL canSendToPhoneNumber;
    @property (nonatomic) VouchrPhoneNumberFormat phoneNumberFormat;
    @property (nonatomic) NSDictionary <NSString *, NSArray <User *> *> *userGroupsVouchersCanBeSentTo;
    
    @end

    Swift

    class RecipientPersonalizationOptionBuilder : PersonalizationOptionBuilder
  • VideoPersonalizationOption represents a Voucher customization which will be available to the user to add videos in the VoucherCreationViewController. Instantiate a VideoPersonalizationOption if you would like the user to be able to add videos to their Voucher. *

    See more

    Declaration

    Objective-C

    @interface VideoPersonalizationOption : PersonalizationOption

    Swift

    class VideoPersonalizationOption : PersonalizationOption
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface  VideoPersonalizationOptionBuilder : PersonalizationOptionBuilder
    
    @property (nonatomic) BOOL canAddYoutubeVideos;
    @property (nonatomic) BOOL canTakeVideo;
    @property (nonatomic) BOOL canSearchYoutube;
    @property (nonatomic) BOOL canClipYoutube;
    
    @property (nonatomic) NSInteger maxVideoLength;
    @property (nonatomic) NSInteger maxVideoSize;
    @property (nonatomic) NSInteger videoCompressionLevel;
    @property (nonatomic) NSInteger maxYoutubeSearchResults;
    
    @end

    Swift

    class VideoPersonalizationOptionBuilder : PersonalizationOptionBuilder
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface VoucherCreationFlowCoordinator : NSObject
    
    
    /**
     Delegate methods called throughout the create process to allow for additional actions and screens to take place 
     @note Default is nil.
     */
    @property (weak, nonatomic) _Nullable id<VoucherCreationFlowDelegate> delegate;
    
    
    + (nonnull instancetype)voucherCreationFlowCoordinatorWithManager:(VoucherCreationManager *)manager
                                                          vouchrTheme:(VouchrTheme *)vouchrTheme
                                                             delegate:(id<VoucherCreationFlowDelegate>)delegate;
    
    - (void)startFlowOnViewController:(UIViewController *)viewController
               personalizationOptions:(NSArray <PersonalizationOption *> *)personalizationOptions;
    
    @end

    Swift

    class VoucherCreationFlowCoordinator : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface VoucherCreationManager : NSObject
    
    /**
     The voucher that is being created. This will be modified throughout the create process via
     any personalizations. It will be become a `Voucher` at the end of the create process.
     @remark Default is a new, empty voucher.
     */
    @property (strong, nonatomic, readonly) MutableVoucher *mutableVoucher;
    
    /**
     Used throughout the create flow to facilitate network calls.
     @note Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VONetworkManagerProtocol> networkManager;
    
    /**
     An instance of `GiftManager` used to create and activate the mutableVoucher.
     @note Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VOGiftManagerProtocol> giftManager;
    
    /**
     Analytics manager used to track events throughout the create flow.
     @note Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VOTrackManagerProtocol> trackManager;
    
    /**
     User manager used to login, get users.
     @note Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VOUserManagerProtocol> userManager;
    
    /**
     Game Manager used to retrieve games.
     @note Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VOGameManagerProtocol> gameManager;
    
    /**
     Used to fetch wrapping papers that the user can use to personalize their voucher.
     @note Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VOWrappingPaperManagerProtocol> wrappingPaperManager;
    
    /*!
     @brief Merchant manager is used to display merchants that the user can purchase gift cards from.
     @remark Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VOMerchantManagerProtocol> merchantManager;
    
    /**
     Youtube manager is used to display Youtube videos that the user can select.
     @note Default is nil.
     */
    @property (weak, nonatomic, readonly) id<VOYoutubeManagerProtocol> youtubeManager;
    
    /**
     A Fullscreen loading view that will be displayed when user interaction needs to be blocked during load time.
     @note Default is a UIActivityIndicator with a semi-transparent overlay.
     */
    @property (strong, nonatomic, readonly) UIView <VouchrLoadingViewProtocol> *fullScreenLoadingView;
    
    /**
     Colours shown in the background of the create screen. Colors are cycled based on wrapping paper selection. After a wrapping paper is chosen, the color closest to the wrapping paper is set as the new background color.
    
     @note Default colors are:
     Red: #E86963, Orange: #FFAD76, Yellow: #FFDA67, Green: #77E097, Teal: #2FCCAD, Navy Blue: #509CDE, Purple: #9372FF
     Pass in an empty array for no color.
     */
    @property (strong, nonatomic, readonly) NSArray <UIColor *> *voucherCreationBackgroundColors;
    
    /**
     Array of colours that is shown in the background of the create screen. After a wrapping paper is chosen,
     the color with the closest average color in the wrapping paper will be chosen from the Array.
     
     @note Default list consists of a single color; white.
     */
    @property (strong, nonatomic, readonly) NSArray <UIColor *> *creationItemBorderColors;
    
    /**
     The border width shown on the items dropped into the envelope.
     @note Default is 7 px.
     */
    @property (nonatomic, readonly) CGFloat creationItemBorderWidth;
    
    /**
     The text shown if the create carousel is emptied (all personalizations completed by the user).
     @note Default text is localized 'Your SURPRiiSE looks awesome!'.
     */
    @property (nonatomic, readonly) NSString *carouselEmptiedText;
    
    /**
     Specifies whether recipient information is required to be entered before sending a Voucher.
     @note Default is YES.
     */
    @property (nonatomic, readonly) BOOL recipientRequired;
    
    /**
     Specifies whether a summary screen should be displayed when no monetary
     value is included in the voucher.
     @note The summary screen displays a breakdown of the price and payment
     @note Default is NO
     */
    @property (nonatomic, readonly) BOOL alwaysShowFullSummaryScreen;
    
    /**
     Minimum number of customizations required before allowing
     the voucher to be created
     @note Default is 1
     */
    @property (nonatomic, readonly) NSInteger minimumNumberOfCustomizations;
    
    /**
     Specifies whether vouchers must include a monetary amount.
     @note Default is YES
     */
    @property (nonatomic, readonly) BOOL allowFreeGifts;
    
    /**
     The `VouchrTheme` for the default summary screen if it is used.
     If not set, the global `VouchrConfig` `VouchrTheme` will be used.
     @note Default is nil.
     */
    @property (nonatomic, readonly) VouchrTheme *defaultSummaryScreenTheme;
    
    /**
     Default initializer for VoucherCreationManager.
     @param builderBlock - block containing builder object used to configure properties in VoucherCreationManager.
     Set desired properties on this builder.
     @return instance of VoucherCreationManager
     */
    + (instancetype)voucherCreationManagerWithBuilder:(void (^)(VoucherCreationManagerBuilder *))builderBlock;
    
    @end

    Swift

    class VoucherCreationManager : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface VoucherCreationManagerBuilder : NSObject
    
    @property (nonatomic) MutableVoucher *mutableVoucher;
    @property (weak, nonatomic) id<VONetworkManagerProtocol> networkManager;
    @property (weak, nonatomic) id<VOGiftManagerProtocol> giftManager;
    @property (weak, nonatomic) id<VOTrackManagerProtocol> trackManager;
    @property (weak, nonatomic) id<VOUserManagerProtocol> userManager;
    @property (weak, nonatomic) id<VOGameManagerProtocol> gameManager;
    @property (weak, nonatomic) id<VOWrappingPaperManagerProtocol> wrappingPaperManager;
    @property (weak, nonatomic) id<VOMerchantManagerProtocol> merchantManager;
    @property (weak, nonatomic) id<VOYoutubeManagerProtocol> youtubeManager;
    @property (strong, nonatomic) UIView <VouchrLoadingViewProtocol> *fullScreenLoadingView;
    @property (strong, nonatomic) NSArray <UIColor *> *voucherCreationBackgroundColors;
    @property (strong, nonatomic) NSArray <UIColor *> *creationItemBorderColors;
    @property (nonatomic) CGFloat creationItemBorderWidth;
    @property (nonatomic) NSString *carouselEmptiedText;
    @property (nonatomic) BOOL recipientRequired;
    @property (nonatomic) BOOL alwaysShowFullSummaryScreen;
    @property (nonatomic) NSInteger minimumNumberOfCustomizations;
    @property (nonatomic) BOOL allowFreeGifts;
    
    @property (nonatomic) VouchrTheme *defaultSummaryScreenTheme;
    
    @end

    Swift

    class VoucherCreationManagerBuilder : NSObject
  • The ‘VoucherCreationViewController’ is the screen responsible for presenting all personalization options and provides visual feedback for alterations to the Voucher. This screen contains the carousel of personalization options at the top and the envelope containing the personalizations below. *

    See more

    Declaration

    Objective-C

    @interface VoucherCreationViewController : UIViewController

    Swift

    class VoucherCreationViewController : UIViewController
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ButtonTheme : NSObject <NSCopying>
    
    @property (nonatomic) FontTheme *fontTheme;
    @property (nonatomic) UIColor *backgroundColor;
    
    @property (nonatomic) CGFloat borderWidth;
    @property (nonatomic) UIColor *borderColor;
    
    @property (nonatomic) CGFloat minWidth;
    @property (nonatomic) CGFloat height;
    @property (nonatomic) CGFloat cornerRadius;
    
    @property (nonatomic) CGSize shadowOffset;
    @property (nonatomic) CGFloat shadowOpacity;
    @property (nonatomic) CGFloat shadowRadius;
    @property (nonatomic) UIColor *shadowColor;
    
    + (instancetype)basePositiveButtonTheme;
    + (instancetype)baseNegativeButtonTheme;
    + (instancetype)baseNeutralButtonTheme;
    
    @end

    Swift

    class ButtonTheme : NSObject, NSCopying
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface FontTheme : NSObject <NSCopying>
    
    @property (nonatomic) UIColor *color;
    @property (nonatomic) UIColor *alternateColor;
    @property (nonatomic) UIFont *font;
    // TODO: rb - add font size modifier
    
    + (instancetype)fontThemeWithFont:(UIFont *)font color:(UIColor *)color;
    
    @end

    Swift

    class FontTheme : NSObject, NSCopying
  • VouchrTheme is used to theme all views of the application. See the VouchrStyleGuide for how the theming is mapped to each view and style recommendations.

    See more

    Declaration

    Objective-C

    @interface VouchrTheme : NSObject <NSCopying>

    Swift

    class VouchrTheme : NSObject, NSCopying
  • VouchrActionSheetItem represents one item inside a VouchrActionSheetViewController. *

    See more

    Declaration

    Objective-C

    @interface VouchrActionSheetItem : NSObject

    Swift

    class VouchrActionSheetItem : NSObject
  • VouchrActionSheetViewController is a custom action sheet used by the SDK. It works similarly to a UIAlertController with style UIAlertControllerStyleActionSheet. Each action sheet item is an action in the controller. If there are too many actions to fit on screen, the actions will become scrollable. A cancel action is automatically added. *

    See more

    Declaration

    Objective-C

    @interface VouchrActionSheetViewController : UIViewController

    Swift

    class VouchrActionSheetViewController : UIViewController