HBAppearanceSettings
Objective-C
@interface HBAppearanceSettings : NSObject
Swift
class HBAppearanceSettings : NSObject
The HBAppearanceSettings class in CepheiPrefs provides a model object read by other components of Cephei to determine colors and other appearence settings to use in the user interface.
Appearance settings are typically set on a view controller, via the
-[PSListController(HBTintAdditions) hb_appearanceSettings]
property. This is automatically
managed by Cephei and provided to view controllers as they are pushed onto the stack.
Most commonly, the API will be used by setting the hb_appearanceSettings
property from the
init method. The following example sets the tint color, table view background color, and
customises the navigation bar with a background, title, and status bar color:
- (instancetype)init {
self = [super init];
if (self) {
HBAppearanceSettings *appearanceSettings = [[HBAppearanceSettings alloc] init];
appearanceSettings.tintColor = [UIColor colorWithRed:66.f / 255.f green:105.f / 255.f blue:154.f / 255.f alpha:1];
appearanceSettings.barTintColor = [UIColor systemRedColor];
appearanceSettings.navigationBarTitleColor = [UIColor whiteColor];
appearanceSettings.tableViewBackgroundColor = [UIColor colorWithWhite:242.f / 255.f alpha:1];
appearanceSettings.statusBarStyle = UIStatusBarStyleLightContent;
self.hb_appearanceSettings = appearanceSettings;
}
return self;
}
-
The tint color to use for interactable elements within the list controller. Set this property to a UIColor to use.
A nil value will cause no modification of the tint to occur.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *tintColor;
Swift
@NSCopying var tintColor: UIColor? { get set }
Return Value
By default, nil.
-
The user interface style to use. Set this property to a UIUserInterfaceStyle to use.
Declaration
Objective-C
@property (nonatomic) UIUserInterfaceStyle userInterfaceStyle;
Swift
var userInterfaceStyle: UIUserInterfaceStyle { get set }
Return Value
By default, UIUserInterfaceStyleUnspecified.
-
The tint color to use for the navigation bar buttons, or, if invertedNavigationBar is set, the background of the navigation bar. Set this property to a UIColor to use, if you don’t want to use the same color as tintColor.
A nil value will cause no modification of the navigation bar tint to occur.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *navigationBarTintColor;
Swift
@NSCopying var navigationBarTintColor: UIColor? { get set }
Return Value
By default, nil.
-
The color to use for the navigation bar title label. Set this property to a UIColor to use.
A nil value will cause no modification of the navigation bar title color to occur.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *navigationBarTitleColor;
Swift
@NSCopying var navigationBarTitleColor: UIColor? { get set }
Return Value
By default, nil.
-
The background color to use for the navigation bar. Set this property to a UIColor to use.
A nil value will cause no modification of the navigation bar background to occur.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *navigationBarBackgroundColor;
Swift
@NSCopying var navigationBarBackgroundColor: UIColor? { get set }
Return Value
By default, nil.
-
The status bar style to use. Set this property to a UIStatusBarStyle to use.
Declaration
Objective-C
@property (nonatomic) UIStatusBarStyle statusBarStyle;
Swift
var statusBarStyle: UIStatusBarStyle { get set }
Return Value
By default, UIStatusBarStyleDefault.
-
Deprecated
Set statusBarStyle instead.
The color to use for the status bar icons. Set this property to a UIColor to use.
A nil value will cause no modification of the status bar color to occur.
Warning
Setting the status bar to a custom color is no longer possible as of iOS 13. Set statusBarStyle instead.Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *statusBarTintColor;
Swift
@NSCopying var statusBarTintColor: UIColor? { get set }
Return Value
By default, nil.
-
Deprecated
Set navigationBarBackgroundColor and navigationBarTitleColor instead.
Whether to use an inverted navigation bar.
An inverted navigation bar has a tinted background, rather than the buttons being tinted. All other interface elements will be tinted the same.
Declaration
Objective-C
@property (nonatomic) BOOL invertedNavigationBar;
Swift
var invertedNavigationBar: Bool { get set }
Return Value
By default, NO.
-
Whether to use a translucent navigation bar. Set this property to YES if you want this behavior.
Declaration
Objective-C
@property (nonatomic) BOOL translucentNavigationBar;
Swift
var translucentNavigationBar: Bool { get set }
Return Value
By default, YES.
-
Whether to show the shadow (separator line) at the bottom of the navigation bar.
Requires iOS 13 or later.
Declaration
Objective-C
@property (nonatomic) BOOL showsNavigationBarShadow;
Swift
var showsNavigationBarShadow: Bool { get set }
Return Value
By default, YES.
-
Whether to use a large title on iOS 11 and newer. Set this property to a value from HBAppearanceSettingsLargeTitleStyle.
Declaration
Objective-C
@property (nonatomic) HBAppearanceSettingsLargeTitleStyle largeTitleStyle;
Swift
var largeTitleStyle: HBAppearanceSettings.LargeTitleStyle { get set }
Return Value
By default, HBAppearanceSettingsLargeTitleStyleRootOnly.
-
The color to be used for the overall background of the table view. Set this property to a UIColor to use.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *tableViewBackgroundColor;
Swift
@NSCopying var tableViewBackgroundColor: UIColor? { get set }
Return Value
By default, nil.
-
The color to be used for the text color of table view cells. Set this property to a UIColor to use.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *tableViewCellTextColor;
Swift
@NSCopying var tableViewCellTextColor: UIColor? { get set }
Return Value
By default, nil.
-
The color to be used for the background color of table view cells. Set this property to a UIColor to use.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *tableViewCellBackgroundColor;
Swift
@NSCopying var tableViewCellBackgroundColor: UIColor? { get set }
Return Value
By default, nil.
-
The color to be used for the separator between table view cells. Set this property to a UIColor to use.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *tableViewCellSeparatorColor;
Swift
@NSCopying var tableViewCellSeparatorColor: UIColor? { get set }
Return Value
By default, nil.
-
The color to be used when a table view cell is selected. This color will be shown when the cell is in the highlighted state.
Declaration
Objective-C
@property (nonatomic, copy, nullable) UIColor *tableViewCellSelectionColor;
Swift
@NSCopying var tableViewCellSelectionColor: UIColor? { get set }
Return Value
By default, nil.