VOPreviewVoucherContentsViewControllerDelegate
@protocol VOPreviewVoucherContentsViewControllerDelegate <NSObject>
VOPreviewVoucherContentsViewControllerDelegate
is the delegate used for passing information between the edit view controller and the voucher creation view controller. If a different edit view controller than the default VOPreviewVoucherContentsViewController
, implement this delegate inside the overridden view controller.
-
This is called when the edit view controller completes with reordered items.
Declaration
Objective-C
- (void)editVoucherContentsViewControllerCompletedWithRearrangedItems: (nonnull NSMutableArray<VOCreationItemView *> *)creationItems;
Swift
func editVoucherContentsViewControllerCompleted(withRearrangedItems creationItems: NSMutableArray)
-
This is called when the edit view controller completes with deleted items.
Declaration
Objective-C
- (void)editVoucherContentsViewControllerCompletedWithDeletedItems: (nonnull NSMutableArray<VOCreationItemView *> *)creationItems;
Swift
func editVoucherContentsViewControllerCompleted(withDeletedItems creationItems: NSMutableArray)
Parameters
creationItems
- the removed items.
-
This is called when the edit view controller completes with an edited item.
Declaration
Objective-C
- (void)editVoucherContentsViewControllerCompletedWithEditingItem: (nonnull VOCreationItemView *)creationItem;
Swift
func editVoucherContentsViewControllerCompleted(withEditingItem creationItem: VOCreationItemView)
Parameters
creationItem
- the item that should be edited.
-
Undocumented
Declaration
Objective-C
- (void)launchCreationScreenOnViewController:(UIViewController *)viewController personalizationOptions:(nullable NSArray <VOPersonalizationOption *> *)personalizationOptions;
Swift
optional func launchCreationScreen(on viewController: UIViewController, personalizationOptions: [VOPersonalizationOption]?)
-
This is called by the voucher creation view controller to drop prepopulated items into the envelope, and update the current
VOVoucher
with the new content.Declaration
Objective-C
- (void)dropPrepopulatedCreationItemsIntoEnvelopeWithVoucher: (nonnull VOVoucher *)voucher creationItems: (nonnull NSArray< VOCreationItemView *> *) creationItems;
Swift
optional func dropPrepopulatedCreationItemsIntoEnvelope(with voucher: VOVoucher, creationItems: [VOCreationItemView])
Parameters
voucher
-
VOVoucher
to be updated with the new content.creationItems
- an array of
VOCreationItemView
specified from prepopulation configurations. -
This delegate method is called after a personalization screen completes with a personalizedObject. If using a non-default Personalization View Controller, it is recommended implementing this method. This method can still be overridden if using a default Personalization View Controller, if you want something other than the default
VOCreationItemView
.Declaration
Objective-C
- (nonnull VOCreationItemView *) creationItemViewForPersonalizationOption: (nonnull VOPersonalizationOption *)personalizationOption personalizedObject:(nonnull id)personalizedObject;
Swift
optional func creationItemView(for personalizationOption: VOPersonalizationOption, personalizedObject: Any) -> VOCreationItemView
Parameters
personalizationOption
- the personalization option that was selected by the user.
personalizedObject
- the object returned by the Personalization View Controller.
Return Value
VOCreationItemView - the
VOCreationItemView
to be dropped in theVOEnvelopeView
. Nil if the default should be used.