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
GCButtonElement
represents 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§
Sourceunsafe fn pressedInput(&self) -> Retained<AnyObject>
Available on crate features GCLinearInput
and GCPressedStateInput
only.
unsafe fn pressedInput(&self) -> Retained<AnyObject>
GCLinearInput
and GCPressedStateInput
only.Get the input containing the pressed state of the button.
Sourceunsafe fn touchedInput(
&self,
) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>
Available on crate feature GCTouchedStateInput
only.
unsafe fn touchedInput( &self, ) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>
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.