RevealPersonalizationViewControllerProtocol
@protocol RevealPersonalizationViewControllerProtocol <NSObject>
RevealPersonalizationViewControllerProtocol
is the interface for any view controllers that are presented from the VoucherRevealViewController
when gift elements are tapped by the user in the reveal view controller.
-
Default initializer for view controller’s presented from the
VoucherRevealViewController
when elements are tapped.Declaration
Objective-C
+ (instancetype)viewControllerWithRevealManager: (VoucherRevealManager *)revealManager object:(id)object;
Swift
static func viewController(with revealManager: VoucherRevealManager!, object: Any!) -> Self!
Parameters
revealManager
- The
VoucherRevealManager
used to initialize theVoucherRevealViewController
.object
- The object associated with the cell that was tapped by the user. Either a
VoucherMedia
or aMerchant
.Return Value
an instance of a view controller.
-
Whether this view controller supports displaying this
VoucherMedia
.Declaration
Objective-C
+ (BOOL)supportsVoucherMedia:(VoucherMedia *)voucherMedia;
Swift
optional static func supportsVoucherMedia(_ voucherMedia: VoucherMedia!) -> Any!
Parameters
voucherMedia
- The voucher media that should be displayed.
Return Value
true if the view controller can display the voucher media, false otherwise.
-
Whether this view controller supports displaying this
Merchant
.Declaration
Objective-C
+ (BOOL)supportsMerchant:(Merchant *)merchant;
Swift
optional static func supportsMerchant(_ merchant: Merchant!) -> Any!
Parameters
merchant
- The merchant that should be displayed.
Return Value
true if the view controller can display the merchant, false otherwise.
-
Passes in the view of the cell that was tapped on from the
VoucherRevealViewController
that can be used to animate the transition of the view controller. If implementing this method, when the view controller dismisses, if the position / transform of this view is changed, it should be returned to its original position and transform.Declaration
Objective-C
- (void)setOriginatingView:(UIView *)view;
Swift
optional func setOriginatingView(_ view: Any!)
Parameters
view
- the cell from the
VoucherRevealViewController
. -
Hides and disables user interaction on the close button for this viewController when presented in
VouchrMediaGalleryViewController
Note
For use when a viewController that conforms to this protocol is presented withinVouchrMediaGalleryViewController
to prevent mutltiple close buttons from being displayed.Declaration
Objective-C
- (void)hideAndDisableCloseButton;
Swift
optional func hideAndDisableCloseButton()