MutableVoucher
@interface MutableVoucher : Voucher
MutableVoucher is the mutable model that represents the bundle of personalizations.
-
The status of the
Voucher. SeeVoucherStatusfor all the possible states.Declaration
Objective-C
@property (assign, readwrite, nonatomic) VoucherStatus status;Swift
var status: VoucherStatus { get set } -
The amount that is given to the
User.Declaration
Objective-C
@property (assign, readwrite, nonatomic) double amount;Swift
var amount: Double { get set } -
The fee associated with the given amount.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) double fee;Swift
var fee: Double { get set } -
The currency of the
Voucher. Eg. USD.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSString *currency;Swift
var currency: String? { get set } -
The payment info provided by the Sender of the
Voucher.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) VoucherPayment *paymentInfo;Swift
var paymentInfo: VoucherPayment? { get set } -
Require a thank you photo to be taken by the claimer of the
Voucherbefore they are able to claim it.Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL isThankYouPhotoRequired;Swift
var isThankYouPhotoRequired: Bool { get set } -
The date the thank you photo was taken for a
Voucher.Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) NSDate *thankYouDate;Swift
var thankYouDate: Date? { get set } -
The date the
Voucherwas created. This date will never change.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSDate *_Nonnull dateCreated;Swift
var dateCreated: Date { get set } -
The date the
Voucheris first able to be claimed. This date will never change.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSDate *_Nonnull dateClaimable;Swift
var dateClaimable: Date { get set } -
Any user ids who have unwrapped the
Voucher.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSArray<NSNumber *> *unwrappedUsers;Swift
var unwrappedUsers: [NSNumber]? { get set } -
TODO: this property
Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSString *shareImageUrl;Swift
var shareImageUrl: String? { get set } -
The privacy status of the
Voucher. Either Private / Friends / Public.Declaration
Objective-C
@property (assign, readwrite, nonatomic) VoucherPrivacyStatus privacy;Swift
var privacy: VoucherPrivacyStatus { get set } -
An array of all media items. This includes pictures, videos, sounds, notes. Customizable by the user when sending the
Voucher.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSArray<VoucherMedia *> *medias;Swift
var medias: [VoucherMedia]? { get set } -
The wrapping paper that shows up on the envelope before the
Voucherhas been claimed.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) WrappingPaperMedia *wrappingPaperMedia;Swift
var wrappingPaperMedia: WrappingPaperMedia? { get set } -
Default initializer to create a
MutableVoucher.Declaration
Objective-C
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)dictionary;Swift
init(dictionary: [AnyHashable : Any])Parameters
dictionary- the dictionary representation of the the
MutableVoucher.Return Value
instance of
MutableVoucher. -
Static initializer to create a
MutableVoucher.Declaration
Objective-C
+ (nonnull instancetype)mutableVoucherWithDictionary: (nonnull NSDictionary *)dictionary;Parameters
dictionary- the dictionary representation of the the
MutableVoucher.Return Value
instance of
MutableVoucher. -
Static initializer to create a
MutableVoucherfrom anotherVoucher. All properties of the Voucher will be copied to theMutableVoucher.Declaration
Objective-C
+ (nonnull instancetype)mutableVoucherWithVoucher:(nonnull Voucher *)voucher;Swift
convenience init(voucher: Voucher)Parameters
voucher- Voucher used to create the
MutableVoucher.Return Value
instance of
MutableVoucher. -
Adds a media object to the
VoucherMediaarray. If no id is set on theVoucherMediaitem, an id will be given.Declaration
Objective-C
- (void)addMedia:(nonnull VoucherMedia *)media;Swift
func addMedia(_ media: VoucherMedia)Parameters
media- The media item to add to the array.
-
Removes a media object from the
VoucherMediaarray. If no id is set on theVoucherMediaitem, an id will be given.Declaration
Objective-C
- (void)removeMedia:(nonnull VoucherMedia *)media;Swift
func removeMedia(_ media: VoucherMedia)Parameters
media- The media item to be removed from the array
-
Removes a
PersonalizationOptioncreation item from theVoucher.Declaration
Objective-C
- (void)removeCreationObjectFromVoucher: (nonnull CreationItemImageView *)creationItem;Swift
func removeCreationObject(fromVoucher creationItem: CreationItemImageView)Parameters
creationItem- The creation item of a
PersonalizationOptionto be removed from theVoucher. -
Clears the
PersonalizationOptioncontents of aMutableVoucher. Does not modifyVoucherspecific properties such as vId and status.Declaration
Objective-C
- (void)clearMutableVoucherData;Swift
func clearData()
View on GitHub
MutableVoucher Class Reference