VoucherCreationViewController
@interface VoucherCreationViewController : UIViewController
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.
-
Delegate for
VoucherCreationViewController
.Declaration
Objective-C
@property (readwrite, nonatomic, nullable) id<VoucherCreationViewControllerDelegate> delegate;
Swift
weak var delegate: VoucherCreationViewControllerDelegate? { get set }
-
+voucherCreationViewControllerWithVoucherCreationManager:createFlowDelegate:vouchrTheme:personalizationOptions:
This method initializes the
VoucherCreationViewController
. This is the default initializer.Declaration
Objective-C
+ (nonnull instancetype) voucherCreationViewControllerWithVoucherCreationManager: (nonnull VoucherCreationManager *)createManager createFlowDelegate: (nonnull id<VoucherCreationFlowDelegate>) createFlowDelegate vouchrTheme:(nonnull VouchrTheme *) vouchrTheme personalizationOptions: (nonnull NSArray<PersonalizationOption *> *)personalizationOptions;
Parameters
createManager
- The manager responsible for handling the flow management in the creation process.
vouchrTheme
- Theme manager for the VoucherCreationViewController
personalizationOptions
- A list containing personalizations accessible to the user. The order of personalization options passed in will be the order they are displayed in.
-
Starts the creation of a new
Voucher
with contents of an existingVoucher
. All personalizations in the passed in voucher will be visualized in the envelope.Declaration
Objective-C
- (void)populateWithVoucher:(nonnull Voucher *)voucher;
Swift
func populate(with voucher: Voucher)
Parameters
voucher
- The
Voucher
object to populate from. -
Reopens envelope and returns to creation state when an user cancels a
Voucher
on the confirmation screen.Declaration
Objective-C
- (void)reopenEnvelope;
Swift
func reopenEnvelope()
-
Adds a recorded video to the
Voucher
being created.Declaration
Objective-C
- (void)addRecordedVideoWithVideoUrl:(nonnull NSURL *)videoUrl thumbnail:(nonnull NSData *)thumbnail analyticsDictionary: (nonnull NSMutableDictionary *)analyticsDictionary;
Swift
func addRecordedVideo(withVideoUrl videoUrl: URL, thumbnail: Data, analyticsDictionary: NSMutableDictionary)
Parameters
videoUrl
- The URL of the video recorded.
thumbnail
- The thumbnail of the video recorded.
analyticsDictionary
- Information regarding the recorded video that needs to be tracked.