BTUIKAppearance.h 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #import <UIKit/UIKit.h>
  2. @interface BTUIKAppearance : NSObject
  3. typedef NS_ENUM(NSInteger, BTUIKColorScheme) {
  4. BTUIKColorSchemeLight,
  5. BTUIKColorSchemeDark,
  6. BTUIKColorSchemeDynamic API_AVAILABLE(ios(13.0))
  7. };
  8. /// Shared instance used by Form elements
  9. + (instancetype)sharedInstance;
  10. /// Fallback color for the overlay if blur is disabled
  11. @property (nonatomic, strong) UIColor *overlayColor;
  12. /// Tint color
  13. @property (nonatomic, strong) UIColor *tintColor;
  14. /// Bar color
  15. @property (nonatomic, strong) UIColor *barBackgroundColor;
  16. /// Font family
  17. @property (nonatomic, strong) NSString *fontFamily;
  18. /// Bold font family
  19. @property (nonatomic, strong) NSString *boldFontFamily;
  20. // Font, defaults to system font
  21. @property (nonatomic, strong, readonly) UIFont *font;
  22. // Bold font, defaults to system bold font
  23. @property (nonatomic, strong, readonly) UIFont *boldFont;
  24. /// Sheet background color
  25. @property (nonatomic, strong) UIColor *formBackgroundColor;
  26. /// Form field background color
  27. @property (nonatomic, strong) UIColor *formFieldBackgroundColor;
  28. /// Primary text color
  29. @property (nonatomic, strong) UIColor *primaryTextColor;
  30. /// Navigation title text color
  31. /// Defaults to nil. When not set, navigation titles will use primaryTextColor
  32. @property (nonatomic, strong) UIColor *navigationBarTitleTextColor;
  33. /// Secondary text color
  34. @property (nonatomic, strong) UIColor *secondaryTextColor;
  35. /// Color of disabled buttons
  36. @property (nonatomic, strong) UIColor *disabledColor;
  37. /// Placeholder text color for form fields
  38. @property (nonatomic, strong) UIColor *placeholderTextColor;
  39. /// Line and border color
  40. @property (nonatomic, strong) UIColor *lineColor;
  41. /// Error foreground color
  42. @property (nonatomic, strong) UIColor *errorForegroundColor;
  43. /// Blur style
  44. @property (nonatomic) UIBlurEffectStyle blurStyle;
  45. /// Activity indicator style
  46. @property (nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
  47. /// Toggle blur effects
  48. @property (nonatomic) BOOL useBlurs;
  49. /// The keyboard the postal code field should use
  50. @property (nonatomic) UIKeyboardType postalCodeFormFieldKeyboardType;
  51. /// The highlighted version of the `tintColor`
  52. @property (nonatomic, readonly, getter = highlightedTintColor) UIColor *highlightedTintColor;
  53. /// Tint color for UISwitch when in the on position
  54. @property (nonatomic, strong) UIColor *switchOnTintColor;
  55. /// Tint color for UISwitch thumb
  56. @property (nonatomic, strong) UIColor *switchThumbTintColor;
  57. /// Color scheme of the Drop-In UI.
  58. ///
  59. /// When set to BTUIKColorSchemeLight, the Drop-In UI uses a light color palette.
  60. /// When set to BTUIKColorSchemeDark, the Drop-In UI uses a dark color palette.
  61. /// When set to BTUIKColorSchemeDynamic, the Drop-In UI uses a dark or light color palette depending on the user's light or dark mode system preference. Only available in iOS 13+
  62. @property (nonatomic) enum BTUIKColorScheme colorScheme;
  63. /// Appearance style of keyboards associated with text fields
  64. @property (nonatomic) UIKeyboardAppearance keyboardAppearance;
  65. /// Sets the color (primary or secondary) and font with family and size (large or small)
  66. /// These properties are on the [BTUIKAppearance sharedInstance]
  67. + (void)styleLabelPrimary:(UILabel *)label;
  68. + (void)styleLabelBoldPrimary:(UILabel *)label;
  69. + (void)styleSmallLabelBoldPrimary:(UILabel *)label;
  70. + (void)styleSmallLabelPrimary:(UILabel *)label;
  71. + (void)styleLabelSecondary:(UILabel *)label;
  72. + (void)styleLargeLabelSecondary:(UILabel *)label;
  73. + (void)styleSystemLabelSecondary:(UILabel *)label;
  74. + (UILabel *)styledNavigationTitleLabel;
  75. + (float)horizontalFormContentPadding;
  76. + (float)formCellHeight;
  77. + (float)verticalFormSpace;
  78. + (float)verticalFormSpaceTight;
  79. + (float)verticalSectionSpace;
  80. + (float)smallIconWidth;
  81. + (float)smallIconHeight;
  82. + (float)largeIconWidth;
  83. + (float)largeIconHeight;
  84. + (NSDictionary*)metrics;
  85. @end