NeoDay iOS SDK - Loyalty Card
/// Makes the Loyalty Card screen.
///
/// - parameter completion: Returns the Loyalty Card screen or an Error.
public func makeLoyaltyCard(
_ completion: @escaping (Result<UIViewController, Error>) -> Void
)
Directly requesting a Loyalty Card screen
The NeoDaySDK factory methods are executed asynchronously in order to fetch the data and return a UIViewController.
sdk.makeLoyaltyCard { [weak self] result in
{ [weak self] result in
guard let self = self else {
return
}
switch result {
case let .success(viewController):
// Display the viewController
case let .failure(error):
// Handle the error
}
}