FTMCCodeGenerator

Contents

public class FTMCCodeGenerator

Fintiv Mobile Commerce QR/Barcode Generator for the given string code

Methods

codeImage(_:code:type:)
public static func codeImage(_ size : CGSize, code : String, type : FTMCCodeType) -> UIImage?

Generates a QR or barcode image

  • Parameters:
    • size: CGSize of the image to generate
    • code: the String code to generate the image for
    • type: the image type to be generated (QR or barcode)
  • Returns: an UIImage in QR or barcode type, if succesful

Parameters

Name Description
size CGSize of the image to generate
code the String code to generate the image for
type the image type to be generated (QR or barcode)
codeImageView(size:code:type:backgroundColor:foregroundColor:)
public static func codeImageView(size : CGSize, code: String, type : FTMCCodeType, backgroundColor : UIColor = .white, foregroundColor : UIColor = .black) -> UIImageView?

Generates a QR or barcode image view

  • Parameters:
    • size: CGSize of the image view to generate
    • code: the String code to generate the image for
    • type: the image type to be generated (QR or barcode)
    • backgroundColor: background color of the image view
    • foregroundColor: foreground color of the image in the image view (QR or barcode color)
  • Returns: a image view in the size and colors precribed in the parameters containing a UIImage representing the QR or barcode for the code

Parameters

Name Description
size CGSize of the image view to generate
code the String code to generate the image for
type the image type to be generated (QR or barcode)
backgroundColor background color of the image view
foregroundColor foreground color of the image in the image view (QR or barcode color)

FTMCStampReaderViewController

Contents

  • Methods
    • stopScanning()
    • startScanning()
    • stampReaderController(forStamp:delegate:)
    • stampReaderController(forStamp:rewardInstance:delegate:)
public final class FTMCStampReaderViewController : UINavigationController

Fintiv Mobile Commer StampReader, used for scanning stamps to a stamp card as well as scanning Rewards. Use static methods stampReaderController… to retrieve and present the controller

  • Precondition: Requires adding NSCameraUsageDescription key to project’s .plist file

Methods

stopScanning()
public static func stopScanning()

Requests the reader to stop scanning for QR Codes

startScanning()
public static func startScanning()

Requests the reader to start scanning for QR Codes

stampReaderController(forStamp:delegate:)
public static func stampReaderController(forStamp stamp : FTMCStampCard, delegate : StampReaderViewControllerDelegate?) -> FTMCStampReaderViewController

Retrieves a StampReaderViewController to be used for adding a stamp to a stamp card

Condition: FTMCStampCard.instance? != nil
The returned controller is a navigation controlle and should be only used for presenting

  • Parameters:
    • stamp: The FTMCStampCard to add the stamp to
    • delegate: optional StampReaderViewController delegate for callbacks
    • Returns: a stamp reader controller setup for adding a stamp to a stamp card

Parameters

Name Description
stamp The FTMCStampCard to add the stamp to
delegate optional StampReaderViewController delegate for callbacks
Returns a stamp reader controller setup for adding a stamp to a stamp card
stampReaderController(forStamp:rewardInstance:delegate:)
public static func stampReaderController(forStamp stamp : FTMCStampCard, rewardInstance : FTMCRewardInstance, delegate : StampReaderViewControllerDelegate?) -> FTMCStampReaderViewController

Retrieves a StampReaderViewController to be used for scanning a reward’s QR code

Condition: FTMCStampCard.instance? != nil, FTMCStampCard.instance.availableRewards > 0
The returned controller is a navigation controlle and should be only used for presenting

  • Parameters:
    • stamp: The FTMCStampCard with an instance containing the reward instance
    • rewardInstance: The reward instance to scan the QR code for.
    • delegate:
  • Returns: a stamp reader controller setup for adding a stamp to a stamp card

Parameters

Name Description
stamp The FTMCStampCard with an instance containing the reward instance
rewardInstance The reward instance to scan the QR code for.
delegate