STPTheme

@interface STPTheme : NSObject <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

    Objective-C

    + (nonnull STPTheme *)defaultTheme;

    Swift

    class func `default`() -> STPTheme
  • The primary background color of the theme. This will be used as the backgroundColor for any views with this theme.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable)
        UIColor *primaryBackgroundColor;

    Swift

    @NSCopying var primaryBackgroundColor: UIColor! { get set }
  • 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

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable)
        UIColor *secondaryBackgroundColor;

    Swift

    @NSCopying var secondaryBackgroundColor: UIColor! { get set }
  • 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

    Objective-C

    @property (readonly, nonatomic) UIColor *_Nonnull tertiaryBackgroundColor;

    Swift

    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

    Objective-C

    @property (readonly, nonatomic) UIColor *_Nonnull quaternaryBackgroundColor;

    Swift

    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

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable)
        UIColor *primaryForegroundColor;

    Swift

    @NSCopying var primaryForegroundColor: UIColor! { get set }
  • 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

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable)
        UIColor *secondaryForegroundColor;

    Swift

    @NSCopying var secondaryForegroundColor: UIColor! { get set }
  • This color is automatically derived from the secondaryForegroundColor with a lower alpha component, used for disabled text.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UIColor *_Nonnull tertiaryForegroundColor;

    Swift

    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

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable) UIColor *accentColor;

    Swift

    @NSCopying var accentColor: UIColor! { get set }
  • The error color of this theme - it will be used for rendering any error messages or views.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable) UIColor *errorColor;

    Swift

    @NSCopying var errorColor: UIColor! { get set }
  • The font to be used for all views using this theme. Make sure to select an appropriate size.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable) UIFont *font;

    Swift

    @NSCopying 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

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable) UIFont *emphasisFont;

    Swift

    @NSCopying 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

    Objective-C

    @property (assign, readwrite, nonatomic) UIBarStyle barStyle;

    Swift

    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

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL translucentNavigationBar;

    Swift

    var translucentNavigationBar: Bool { get set }
  • This font is automatically derived from the font, with a slightly lower point size, and will be used for supplementary labels.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UIFont *_Nonnull smallFont;

    Swift

    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

    Objective-C

    @property (readonly, nonatomic) UIFont *_Nonnull largeFont;

    Swift

    var largeFont: UIFont { get }