Pay Kit iOS: UI Components
PayKitUI provides an unmanaged CashAppPayButton and a CashAppPaymentMethod view in both UIKit and SwiftUI.
These views accept a SizingCategory to specify the preferred size of the view within your app.
These views must be used as-is, without modification.
CashAppPayButton
By default, the button shows the Cash App icon and “Cash App Pay”. Pass a label to show a call to action instead:
The button comes in these styles:
.black: White label and green Cash App icon on a black background.white: Black label and green Cash App icon on a white background with a thin black outline.monochromeBlack: White label and icon on a black background.monochromeWhite: Black label and icon on a white background with a thin black outline.green: Black label and icon on a Cash App green background.automatic(default): Follows the system’s light or dark mode, showing.blackin light mode and.whitein dark mode.monochromeAutomatic: Follows the system’s light or dark mode, showing.monochromeBlackin light mode and.monochromeWhitein dark mode
You can use the following example for instantiating the button:
In SwiftUI:
The earlier usePolychromeAsset: initializers still work but are deprecated. Use style: .green in place of usePolychromeAsset: true, or style: .monochromeAutomatic for the look usePolychromeAsset: false had.
CashAppPaymentMethod
CashAppPaymentMethod shows the Cash App Pay logo and the customer’s Cashtag, for example after the customer approves a request. The .large size puts the Cashtag to the right of the logo, and .small puts it under the logo.
The monochrome logo follows the system’s light or dark theme. Set usePolychromeAsset to show the green Cash App icon: on a black background in light mode, and on a green background in dark mode.
To show the “Cash App” logo instead of “Cash App Pay”, pass label: .cashApp to the initializer or set the label property.
You can use the following example for instantiating the view: