Contents

appearanceWhenContainedIn:

Returns the appearance proxy for object when it’s contained in the hierarchy the specified classes describe.

Declaration

+ (instancetype) appearanceWhenContainedIn:(Class<UIAppearanceContainer> *) ContainerClass;

Parameters

  • ContainerClass:

    A nil-terminated list of appearance container classes, in ascending hierarchical order.

Return Value

The appearance proxy to use for the object.

Discussion

Set the ContainerClass array to an ascending hierarchical list of containing types. For example, if you want a navigation bar to take on a specific appearance when contained in a navigation controller inside a tab bar controller, set ContainerClass to @[[UINavigationController class], [UITabBarController class], nil].

Do not set ContainerClass to an unrelated list of types or to a list that does not match the containment hierarchy of your user interface.

This method throws an exception for any item in the var-args list that is not a Class object that conforms to the UIAppearanceContainer protocol.

See Also

Working with the appearance proxy