STPTheme

final public class STPTheme : NSObject
extension STPTheme: NSCopying

STPTheme objects can be used to visually style Stripe-provided UI. See https://stripe.com/docs/mobile/ios/standard#theming for more information.

  • The default theme used by all Stripe UI. All themable UI classes, such as STPAddCardViewController, have one initializer that takes a theme and one that does not. If you use the one that does not, the default theme will be used to customize that view controller’s appearance.

    Declaration

    Swift

    @objc
    public static let defaultTheme: STPTheme
  • The primary background color of the theme. This will be used as the backgroundColor for any views with this theme.

    Declaration

    Swift

    @objc
    public var primaryBackgroundColor: UIColor
  • The secondary background color of this theme. This will be used as the backgroundColor for any supplemental views inside a view with this theme - for example, a UITableView will set it’s cells’ background color to this value.

    Declaration

    Swift

    @objc
    public var secondaryBackgroundColor: UIColor
  • This color is automatically derived by reducing the alpha of the primaryBackgroundColor and is used as a section border color in table view cells.

    Declaration

    Swift

    @objc
    public var tertiaryBackgroundColor: UIColor { get }
  • This color is automatically derived by reducing the brightness of the primaryBackgroundColor and is used as a separator color in table view cells.

    Declaration

    Swift

    @objc
    public var quaternaryBackgroundColor: UIColor { get }
  • The primary foreground color of this theme. This will be used as the text color for any important labels in a view with this theme (such as the text color for a text field that the user needs to fill out).

    Declaration

    Swift

    @objc
    public var primaryForegroundColor: UIColor
  • The secondary foreground color of this theme. This will be used as the text color for any supplementary labels in a view with this theme (such as the placeholder color for a text field that the user needs to fill out).

    Declaration

    Swift

    @objc
    public var secondaryForegroundColor: UIColor
  • This color is automatically derived from the secondaryForegroundColor with a lower alpha component, used for disabled text.

    Declaration

    Swift

    @objc
    public var tertiaryForegroundColor: UIColor { get }
  • The accent color of this theme - it will be used for any buttons and other elements on a view that are important to highlight.

    Declaration

    Swift

    @objc
    public var accentColor: UIColor
  • The error color of this theme - it will be used for rendering any error messages or views.

    Declaration

    Swift

    @objc
    public var errorColor: UIColor
  • The font to be used for all views using this theme. Make sure to select an appropriate size.

    Declaration

    Swift

    @objc
    public var font: UIFont { get set }
  • The medium-weight font to be used for all bold text in views using this theme. Make sure to select an appropriate size.

    Declaration

    Swift

    @objc
    public var emphasisFont: UIFont { get set }
  • The navigation bar style to use for any view controllers presented modally by the SDK. The default value will be determined based on the brightness of the theme’s secondaryBackgroundColor.

    Declaration

    Swift

    @objc
    public var barStyle: UIBarStyle { get set }
  • A Boolean value indicating whether the navigation bar for any view controllers presented modally by the SDK should be translucent. The default value is YES.

    Declaration

    Swift

    @objc
    public var translucentNavigationBar: Bool
  • This font is automatically derived from the font, with a slightly lower point size, and will be used for supplementary labels.

    Declaration

    Swift

    @objc
    public var smallFont: UIFont { get }
  • This font is automatically derived from the font, with a larger point size, and will be used for large labels such as SMS code entry.

    Declaration

    Swift

    @objc
    public var largeFont: UIFont { get }