VoucherCreationViewControllerDelegate
@protocol VoucherCreationViewControllerDelegate <NSObject>
The ‘VoucherCreationViewControllerDelegate’ is the object responsible for supplying additional screens needed for the creation of a Voucher.
Screens include login screen, proceed screen, and customized personalization screens.
-
This delegate callback occurs when the user wants to proceed with their
Voucherbut is not currently logged in. Perform a login or prompt the user to login during this callback and then execute the completion block.Declaration
Objective-C
- (void)createViewController: (nonnull VoucherCreationViewController *)viewController needsLoginWithCompletion:(nonnull void (^)(NSError *_Nonnull))completion;Swift
func createViewController(_ viewController: VoucherCreationViewController, needsLoginWithCompletion completion: @escaping (Error) -> Void)Parameters
viewController- The current
VoucherCreationViewControllerbeing actioned on.completion- Block containing additional tasks to be executed upon logging in. Pass in nil if login was successful, the corresponding
NSErrorif login has failed. -
This delegate callback occurs when the user has completed their actions on the
VoucherCreationViewControllerand wants to proceed with sending their voucher.Declaration
Objective-C
- (void)createViewController: (nonnull VoucherCreationViewController *)viewController completedWithEnvelopeFrame:(CGRect)envelopeFrame backgroundColor:(nonnull UIColor *)backgroundColor;Swift
func createViewController(_ viewController: VoucherCreationViewController, completedWithEnvelopeFrame envelopeFrame: CGRect, backgroundColor: UIColor)Parameters
viewController- The current
VoucherCreationViewControllerbeing actioned on.envelopeFrame- The frame of the envelope on the
VoucherCreationViewController. This frame is intended to be used for any custom transitions or animations of the envelope on the next view controller.backgroundColor- The current background color of the
VoucherCreationViewController. It is supplied in the case consistency is required on the next screen. -
This delegate callback occurs when the user wants to add a particular personalization to their voucher.
Declaration
Objective-C
- (nonnull UIViewController<PersonalizationOptionViewControllerProtocol> *) personalizationViewControllerForPersonalizationOption: (nonnull PersonalizationOption *)personalizationOption;Parameters
personalizationOption- The personalization option selected by the user.
Return Value
The
UIViewControllerpresented to the user that allows customization of the desired personalization for the voucher. The view controller must conform to thePersonalizationOptionViewControllerProtocolprotocol. -
This delegate callback occurs when the user completes a personalization option. A
CreationItemImageViewshould be returned that represents the element dropped into theEnvelopeView.Declaration
Objective-C
- (nonnull CreationItemImageView *) creationItemImageViewForPersonalizationOption: (nonnull PersonalizationOption *)personalizationOption personalizedObject:(nonnull id)personalizedObject;Swift
func creationItemImageView(for personalizationOption: PersonalizationOption, personalizedObject: Any) -> CreationItemImageViewParameters
personalizationOption- The personalization option selected by the user.
personalizedObject- the object returned by the Personalization View Controller.
Return Value
CreationItemImageView - the
CreationItemImageViewto be dropped in theEnvelopeView. Nil if the default should be used. -
This delegate callback occurs when the
VoucherCreationViewControllerneeds to be dismissed.Declaration
Objective-C
- (void)createViewControllerCancelled;Swift
func createViewControllerCancelled()
View on GitHub
VoucherCreationViewControllerDelegate Protocol Reference