HBAppearanceSettings

@interface HBAppearanceSettings : NSObject

The HBAppearanceSettings class in CepheiPrefs provides a model object read by other components of Cephei to determine colors 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.

This interface replaces the previous method that worked in the opposite way – HBListController would work backwards to find a view controller with appearance settings defined. This was not robust, created messy code within Cephei, and can cause a mix of colors if a view controller with different settings to the prior one is pushed.

Use of the old properties on HBListController will cause a warning to be logged.

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 enables an inverted navigation bar:

- (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.tableViewBackgroundColor = [UIColor colorWithWhite:242.f / 255.f alpha:1];
        appearanceSettings.invertedNavigationBar = YES;
        self.hb_appearanceSettings = appearanceSettings;
    }

    return self;
}
  • The tint color to use for interactable elements within the list controller. Override this method to return a UIColor to use.

    A nil value will cause no modification of the tint to occur.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) UIColor *tintColor;

    Swift

    @NSCopying var tintColor: UIColor? { get set }
  • The tint color to use for the navigation bar buttons, or, if hb_invertedNavigationBar is set, the background of the navigation bar. Override this method to return a UIColor to use, if you don’t want to use the same color as hb_tintColor.

    A nil value will cause no modification of the navigation bar tint to occur.

    @returns By default, the return value of hb_tintColor.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) UIColor *navigationBarTintColor;

    Swift

    @NSCopying var navigationBarTintColor: UIColor? { get set }
  • The color to use for the navigation bar title label. Override this method to return a UIColor to use.

    A nil value will cause no modification of the navigation bar title color to occur.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        UIColor *navigationBarTitleColor;

    Swift

    @NSCopying var navigationBarTitleColor: UIColor? { get set }
  • The background color to use for the navigation bar. Override this method to return a UIColor to use.

    A nil value will cause no modification of the navigation bar background to occur.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        UIColor *navigationBarBackgroundColor;

    Swift

    @NSCopying var navigationBarBackgroundColor: UIColor? { get set }
  • The color to use for the status bar icons. Override this method to return a UIColor to use.

    A nil value will cause no modification of the status bar color to occur.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) UIColor *statusBarTintColor;

    Swift

    @NSCopying var statusBarTintColor: UIColor? { get set }
  • Whether to use an inverted navigation bar.

    Deprecated. Set navigationBarBackgroundColor and navigationBarTitleColor instead.

    An inverted navigation bar has a tinted background, rather than the buttons being tinted. All other interface elements will be tinted the same.

    @returns By default, NO.

    Declaration

    Objective-C

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

    Swift

    var invertedNavigationBar: Bool { get set }
  • Whether to use a translucent navigation bar. Override this method if you want this behavior.

    @returns By default, YES.

    Declaration

    Objective-C

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

    Swift

    var translucentNavigationBar: Bool { get set }
  • The color to be used for the overall background of the table view. Override this method to return a UIColor to use.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        UIColor *tableViewBackgroundColor;

    Swift

    @NSCopying var tableViewBackgroundColor: UIColor? { get set }
  • The color to be used for the text color of table view cells. Override this method to return a UIColor to use.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) UIColor *tableViewCellTextColor;

    Swift

    @NSCopying var tableViewCellTextColor: UIColor? { get set }
  • The color to be used for the background color of table view cells. Override this method to return a UIColor to use.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        UIColor *tableViewCellBackgroundColor;

    Swift

    @NSCopying var tableViewCellBackgroundColor: UIColor? { get set }
  • The color to be used for the separator between table view cells. Override this method to return a UIColor to use.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        UIColor *tableViewCellSeparatorColor;

    Swift

    @NSCopying var tableViewCellSeparatorColor: UIColor? { get set }
  • 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.

    Override this method to return a UIColor to use.

    @returns By default, nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable)
        UIColor *tableViewCellSelectionColor;

    Swift

    @NSCopying var tableViewCellSelectionColor: UIColor? { get set }