BPKThemeContainerController

@interface BPKThemeContainerController : BPKContainerController

A subclass of BPKContainerController which manages the application of a theme.

The view controller hierarchy and thus view hierarchy contained in the controller is conditionally rendered inside a container. By leveraging the container relationship consumers can use UIAppearance to alter the look of all views rendered within the container.

  • Create an instance with a given theme and root view controller.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithThemeDefinition:(nonnull id<BPKThemeDefinition>)themeDefinition
             rootViewController:(nonnull UIViewController *)rootViewController;

    Swift

    init(themeDefinition: BPKThemeDefinition, rootViewController: UIViewController)

    Parameters

    themeDefinition

    The theme that we want to wrap the view hierarchy in.

    rootViewController

    The root view controller to be used as a child view controller.

    Return Value

    A configured instance that can further be contained or set to be the rootViewController of a window.

  • The theme container that is currently being used if the theme is active. Changing the value of this property will immediately cause the view hierarchy to update to reflect the new state. As such it should only be called on the main thread.

    Declaration

    Objective-C

    @property (nonatomic, strong) id<BPKThemeDefinition> _Nonnull themeDefinition;

    Swift

    var themeDefinition: BPKThemeDefinition { get set }