VOVoucherCreationFlowCoordinator

@interface VOVoucherCreationFlowCoordinator : NSObject

VOVoucherCreationFlowCoordinator is an object that initiates the creation of a VOVoucher.

  • Delegate methods called throughout the create process to allow for additional actions and screens to take place

    Note

    Default is nil.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<VOVoucherCreationFlowDelegate>
        delegate;

    Swift

    weak var delegate: VOVoucherCreationFlowDelegate? { get set }
  • Default initializer for VoucherCreationCoordinator.

    Declaration

    Objective-C

    + (nonnull instancetype)
        voucherCreationFlowCoordinatorWithCreationManager:
            (nonnull VOVoucherCreationManager *)creationManager
                                          discoverManager:
                                              (nullable VODiscoverManager *)
                                                  discoverManager
                                              vouchrTheme:
                                                  (nonnull VOTheme *)vouchrTheme
                                                 delegate:
                                                     (nonnull id<
                                                         VOVoucherCreationFlowDelegate>)
                                                         delegate;

    Swift

    convenience init(creationManager: VOVoucherCreationManager, discoverManager: VODiscoverManager?, vouchrTheme: VOTheme, delegate: VOVoucherCreationFlowDelegate)

    Parameters

    creationManager

    - An instance of VOVoucherCreationManager used in the flow of creating a new VOVoucher.

    discoverManager

    - An instance of VODiscoverManager used to populate Discover content.

    vouchrTheme

    - The object that holds base theme settings for the creation flow.

    delegate

    - The object responsible for implementing VoucherCreationCoordinator callbacks.

  • Used to launch the Discover Screen flow on the specified view controller. Discover screen is a landing page from which the user can jumpstart their creation flow with prebuilt content.

    Declaration

    Objective-C

    - (void)launchDiscoverScreenVersion:(VODiscoverScreenVersion)version
                       onViewController:(nonnull UIViewController *)viewController
                 personalizationOptions:
                     (nullable NSArray<VOPersonalizationOption *> *)
                         personalizationOptions
                        discoverBuilder:
                            (nonnull void (^)(VODiscoverScreenBuilder *_Nonnull))
                                builderBlock;

    Swift

    func launch(_ version: VODiscoverScreenVersion, on viewController: UIViewController, personalizationOptions: [VOPersonalizationOption]?, discoverBuilder builderBlock: @escaping (VODiscoverScreenBuilder) -> Void)

    Parameters

    viewController

    - The view controller the Discover Screen starts on.

    personalizationOptions

    - A list of VOPersonalizationOptions included in the creation flow.

  • Used to start the creation flow on selected view controller.

    Declaration

    Objective-C

    - (void)launchCreationScreenOnViewController:
                (nonnull UIViewController *)viewController
                          personalizationOptions:
                              (nullable NSArray<VOPersonalizationOption *> *)
                                  personalizationOptions;

    Swift

    func launchCreationScreen(on viewController: UIViewController, personalizationOptions: [VOPersonalizationOption]?)

    Parameters

    viewController

    - The view controller the creation flow starts on.

    personalizationOptions

    - A list of VOPersonalizationOptions included in the creation flow.

  • Used to start the creation flow on selected view controller.

    Declaration

    Objective-C

    - (void)launchCreationScreenOnViewController:
                (nonnull UIViewController *)viewController
                          personalizationOptions:
                              (nullable NSArray<VOPersonalizationOption *> *)
                                  personalizationOptions
                                  mutableVoucher:
                                      (nonnull VOMutableVoucher *)mutableVoucher;

    Swift

    func launchCreationScreen(on viewController: UIViewController, personalizationOptions: [VOPersonalizationOption]?, mutableVoucher: VOMutableVoucher)

    Parameters

    viewController

    - The view controller the creation flow starts on.

    personalizationOptions

    - A list of VOPersonalizationOptions included in the creation flow.

    mutableVoucher

    - The voucher to prepopulate the creation flow.

  • Used to launch the Preview Screen, which displays personalizations the user can add to their voucher.

    Declaration

    Objective-C

    - (void)launchPreviewScreenOnViewController:
                (nonnull UIViewController *)viewController
                         personalizationOptions:
                             (nullable NSArray<VOPersonalizationOption *> *)
                                 personalizationOptions
                                    vouchrTheme:(nonnull VOTheme *)vouchrTheme
                                creationManager:(nonnull VOVoucherCreationManager *)
                                                    creationManager
                                flowCoordinator:
                                    (nonnull VOVoucherCreationFlowCoordinator *)
                                        flowCoordinator
                                        voucher:(nonnull VOVoucher *)voucher;

    Swift

    func launchPreviewScreen(on viewController: UIViewController, personalizationOptions: [VOPersonalizationOption]?, vouchrTheme: VOTheme, creationManager: VOVoucherCreationManager, flowCoordinator: VOVoucherCreationFlowCoordinator, voucher: VOVoucher)

    Parameters

    viewController

    - The view controller the creation flow starts on.

    personalizationOptions

    - A list of VOPersonalizationOptions included in the creation flow.

    vouchrTheme

    - The object that holds base theme settings for the creation flow.

    creationManager

    - An instance of VOVoucherCreationManager used in the flow of creating a new VOVoucher.

    flowCoordinator

    - An instance of ‘VOVoucherCreationFlowCoordinator’, which launches and receives callbacks from default personalization option screens.

    voucher

    - The voucher that includes contents to be previewed.

  • Used to launch Discover Preview V2 screen

    Declaration

    Objective-C

    - (void)
        launchDiscoverPreviewV2OnViewController:
            (nonnull VODiscoverScreenV2ViewController *)
                discoverScreenV2ViewController
                                    vouchrTheme:(nonnull VOTheme *)vouchrTheme
                                creationManager:(nonnull VOVoucherCreationManager *)
                                                    creationManager
                                flowCoordinator:
                                    (nonnull VOVoucherCreationFlowCoordinator *)
                                        flowCoordinator
                       voucherTemplateCellModel:
                           (nonnull VOVoucherTemplateCellModel *)
                               voucherTemplateCellModel
                                       delegate:
                                           (nonnull id<
                                               VODiscoverPreviewV2ViewControllerDelegate>)
                                               delegate;
  • Used to launch the default Reveal Animation from the default Creation Screen.

    Declaration

    Objective-C

    - (void)launchRevealScreenFromCreationViewControllerWithVoucher:
        (nonnull VOVoucher *)voucher;

    Swift

    func launchRevealScreenFromCreationViewController(with voucher: VOVoucher)

    Parameters

    voucher

    - The voucher with contents for the reveal animation to show.

  • Used to launch the default Reveal Animation from the specified ‘viewController’ parameter.

    Declaration

    Objective-C

    - (void)launchRevealScreenFromViewController:
                (nonnull UIViewController *)viewController
                                     withVoucher:(nonnull VOVoucher *)voucher;

    Swift

    func launchRevealScreen(from viewController: UIViewController, with voucher: VOVoucher)

    Parameters

    voucher

    - The voucher with contents for the reveal animation to show.

  • Used to launch the default Edit Screen from the default Creation Screen.

    Declaration

    Objective-C

    - (void)launchEditScreenFromCreationViewControllerWithCreationItems:
        (nonnull NSMutableArray<VOCreationItemView *> *)creationItems;

    Swift

    func launchEditScreenFromCreationViewController(withCreationItems creationItems: NSMutableArray)

    Parameters

    creationItems

    - An array of ‘VOCreationItemView’s for the Edit Screen to display. Each item represents a personalization.

  • Used to launch the default Send VOVoucher Screen from the default or custom Creation Screen.

    Declaration

    Objective-C

    - (void)
        launchSendVoucherScreenFromCreationViewControllerWithCreationItems:
            (nonnull NSMutableArray<VOCreationItemView *> *)creationItems
                                                           backgroundColor:
                                                               (nonnull UIColor *)
                                                                   backgroundColor;

    Swift

    func launchSendVoucherScreenFromCreationViewController(withCreationItems creationItems: NSMutableArray, backgroundColor: UIColor)

    Parameters

    creationItems

    - An array of ‘VOCreationItemView’s. Allows checking for minimum number of personalizations.

    backgroundColor

    - The background color of the default Send VOVoucher Screen.

  • Used to launch the default Send VOVoucher Screen from the default Creation Screen.

    Declaration

    Objective-C

    - (void)
        launchSendVoucherScreenFromCreationViewControllerWithEnvelopeView:
            (nonnull UIView *)envelopeView
                                                            creationItems:
                                                                (nonnull
                                                                     NSMutableArray<
                                                                         VOCreationItemView
                                                                             *> *)
                                                                    creationItems
                                                          backgroundColor:
                                                              (nonnull UIColor *)
                                                                  backgroundColor;

    Swift

    func launchSendVoucherScreenFromCreationViewController(withEnvelopeView envelopeView: UIView, creationItems: NSMutableArray, backgroundColor: UIColor)

    Parameters

    envelopeView

    - The gift package from the default Creation Screen. The frame is used as a starting point for the transition animation.

    creationItems

    - An array of ‘VOCreationItemView’s. Allows checking for minimum number of personalizations.

    backgroundColor

    - The background color of the default Send VOVoucher Screen.

  • Used to launch a default Personalization Screen.

    Declaration

    Objective-C

    - (void)launchPersonalizationViewControllerForPersonalizationOption:
        (nonnull VOPersonalizationOption *)personalizationOption;

    Swift

    func launchPersonalizationViewController(for personalizationOption: VOPersonalizationOption)

    Parameters

    personalizationOption

    - The personalization option that identifies the default personalization screen to launch.

  • Used to set a boolean to indicate whether or not to use the Wells Fargo Creation View Controller

    Declaration

    Objective-C

    - (void)setIsStackedViewController:(BOOL)isStackedViewController;

    Swift

    func setIsStackedViewController(_ isStackedViewController: Bool)

    Parameters

    isStackedViewController

    - Boolean to identify whether or not to display the Stacked View Controller

  • Used to populate the envelope with a pre-existing voucher.

    Declaration

    Objective-C

    - (void)populateWithVoucher:(nonnull VOVoucher *)voucher;

    Swift

    func populate(with voucher: VOVoucher)

    Parameters

    voucher

    - The voucher to be added to the envelope at the start of the creation flow.

  • Used to populate the wrapping paper for a VOVoucherCreationStackedViewController.

    Declaration

    Objective-C

    - (void)populateWithWrappingPaperMedia:
        (nonnull VOWrappingPaperMedia *)wrappingPaperMedia;

    Swift

    func populate(with wrappingPaperMedia: VOWrappingPaperMedia)

    Parameters

    wrappingPaperMedia

    - The media to populate the wrapping paper used on the envelope.

  • Used to dismiss the Creation Screen.

    Note

    Default behavior pops the Creation Screen’s navigation controller. If a navigation controller is not present, ‘VOVoucherCreationFlowCoordinator’ calls its delegate’s ‘dismissPresentedViewControllerAnimated:completion:’ method.

    Declaration

    Objective-C

    - (void)createViewControllerCancelled;

    Swift

    func createViewControllerCancelled()
  • Undocumented

    Declaration

    Objective-C

    - (void)continueFlowToVoucherSummaryScreen;

    Swift

    func continueFlowToVoucherSummaryScreen()
  • Prepares the creation flow coordinator for a new flow.

    Note

    Use this to deallocate leftover properties after successful voucher send.

    Declaration

    Objective-C

    - (void)resetCreationFlowCoordinator;

    Swift

    func resetCreationFlowCoordinator()
  • This callback occurs when the user wants to proceed with their VOVoucher but 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 UIViewController<VOVoucherCreationViewControllerProtocol>
                     *)viewController
        needsLoginWithCompletion:(nonnull void (^)(NSError *_Nonnull))completion;

    Swift

    func createViewController(_ viewController: UIViewController & VOVoucherCreationViewControllerProtocol, needsLoginWithCompletion completion: @escaping (Error) -> Void)

    Parameters

    viewController

    - The current voucher creation view controller being actioned on.

    completion

    - Block containing additional tasks to be executed upon logging in. Pass in nil if login was successful, the corresponding NSError if login has failed.

  • This callback occurs when the user has completed their actions on the voucher creation view controller and wants to proceed with sending their voucher.

    Declaration

    Objective-C

    - (void)createViewController:
                (nonnull UIViewController<VOVoucherCreationViewControllerProtocol>
                     *)viewController
        completedWithEnvelopeFrame:(CGRect)envelopeFrame
                   backgroundColor:(nonnull UIColor *)backgroundColor;

    Swift

    func createViewController(_ viewController: UIViewController & VOVoucherCreationViewControllerProtocol, completedWithEnvelopeFrame envelopeFrame: CGRect, backgroundColor: UIColor)

    Parameters

    viewController

    - The current voucher creation view controller being actioned on.

    envelopeFrame

    - The frame of the envelope on the voucher creation view controller. 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 voucher creation view controller. It is supplied in the case consistency is required on the next screen.