Trait GCButtonElement

Source
pub unsafe trait GCButtonElement: GCPhysicalInputElement {
    // Provided methods
    unsafe fn pressedInput(&self) -> Retained<AnyObject>
       where Self: Sized + Message { ... }
    unsafe fn touchedInput(
        &self,
    ) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>
       where Self: Sized + Message { ... }
}
Available on crate features GCButtonElement and GCPhysicalInputElement only.
Expand description

An object conforming to GCButtonElementrepresents a momentary switch, such as a push button. A button’s input only asserts while the user is interacting with it, and then returns to a preferred state (not pressed, not touched).

See also Apple’s documentation

Provided Methods§

Source

unsafe fn pressedInput(&self) -> Retained<AnyObject>
where Self: Sized + Message,

Available on crate features GCLinearInput and GCPressedStateInput only.

Get the input containing the pressed state of the button.

Source

unsafe fn touchedInput( &self, ) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>
where Self: Sized + Message,

Available on crate feature GCTouchedStateInput only.

Get the input containing the touched state of the button.

Some buttons feature capacitive touch capabilities where the user can touch the button without pressing it.

Trait Implementations§

Source§

impl ProtocolType for dyn GCButtonElement

Source§

const NAME: &'static str = "GCButtonElement"

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 GCButtonElement

Implementations on Foreign Types§

Source§

impl<T> GCButtonElement for ProtocolObject<T>
where T: ?Sized + GCButtonElement,

Implementors§