UITraitDefinition

Trait UITraitDefinition 

Source
pub unsafe trait UITraitDefinition: MainThreadOnly {
    // Provided methods
    unsafe fn identifier(mtm: MainThreadMarker) -> Retained<NSString>
       where Self: Sized + ClassType { ... }
    unsafe fn name(mtm: MainThreadMarker) -> Retained<NSString>
       where Self: Sized + ClassType { ... }
    unsafe fn affectsColorAppearance(mtm: MainThreadMarker) -> bool
       where Self: Sized + ClassType { ... }
}
Available on crate feature UITrait only.
Expand description

Provided Methods§

Source

unsafe fn identifier(mtm: MainThreadMarker) -> Retained<NSString>
where Self: Sized + ClassType,

A unique identifier string for the trait (reverse-DNS format recommended). Allows the trait to be encoded/decoded, and to map both a Swift and Objective-C trait to the same data.

Source

unsafe fn name(mtm: MainThreadMarker) -> Retained<NSString>
where Self: Sized + ClassType,

A short human-readable name for the trait, e.g. for printing and debugging output. By default, the trait’s class name is used when not implemented.

Source

unsafe fn affectsColorAppearance(mtm: MainThreadMarker) -> bool
where Self: Sized + ClassType,

Whether the trait is used to resolve dynamic colors (or images), and changes to the trait should automatically trigger views using dynamic colors/images to update their appearance. Default is NO.

Trait Implementations§

Source§

impl ProtocolType for dyn UITraitDefinition

Source§

const NAME: &'static str = "UITraitDefinition"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn UITraitDefinition

Implementations on Foreign Types§

Source§

impl<T> UITraitDefinition for ProtocolObject<T>

Implementors§