iOS Developer Library

Developer

UIKit Framework Reference UIAppearance Protocol Reference

Options
Deployment Target:

On This Page
Language:

UIAppearance

Use the UIAppearance protocol to get the appearance proxy for a class. You can customize the appearance of instances of a class by sending appearance modification messages to the class’s appearance proxy. More...

Inheritance


Not Applicable

Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 5.0 and later.
  • Returns the appearance proxy for the receiver. (required)

    Declaration

    Swift

    class func appearance() -> Self!

    Objective-C

    + (instancetype)appearance

    Return Value

    The appearance proxy for the receiver.

    Import Statement

    import UIKit

    Availability

    Available in iOS 5.0 and later.

  • Returns the appearance proxy for the receiver that has the passed trait collection. (required)

    Declaration

    Swift

    class func appearanceForTraitCollection(_ trait: UITraitCollection) -> Self!

    Objective-C

    + (instancetype)appearanceForTraitCollection:(UITraitCollection *)trait

    Parameters

    trait

    The trait collection used for matching.

    Return Value

    The appearance proxy for the receiver.

    Import Statement

    import UIKit

    Availability

    Available in iOS 8.0 and later.

  • Returns the appearance proxy for the receiver in a given containment hierarchy that has the passed trait collection. (required)

    Declaration

    Objective-C

    + (instancetype)appearanceForTraitCollection:(UITraitCollection *)trait whenContainedIn:(Class<UIAppearanceContainer>)ContainerClass, ...

    Parameters

    trait

    The trait collection used for matching.

    ContainerClass,

    A nil-terminated list of appearance container classes.

    Return Value

    The appearance proxy for the receiver in a given containment hierarchy.

    Discussion

    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.

    Import Statement

    Availability

    Available in iOS 8.0 and later.

  • Returns the appearance proxy for the receiver in a given containment hierarchy. (required)

    Declaration

    Objective-C

    + (instancetype)appearanceWhenContainedIn:(Class<UIAppearanceContainer>)ContainerClass, ...

    Parameters

    ContainerClass,

    A nil-terminated list of appearance container classes.

    Return Value

    The appearance proxy for the receiver in a given containment hierarchy.

    Discussion

    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.

    Import Statement

    Availability

    Available in iOS 5.0 and later.