Trait UISpringLoadedInteractionContext

Source
pub unsafe trait UISpringLoadedInteractionContext: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    unsafe fn state(&self) -> UISpringLoadedInteractionEffectState
       where Self: Sized + Message { ... }
    unsafe fn targetView(&self) -> Option<Retained<UIView>>
       where Self: Sized + Message { ... }
    unsafe fn setTargetView(&self, target_view: Option<&UIView>)
       where Self: Sized + Message { ... }
    unsafe fn targetItem(&self) -> Option<Retained<AnyObject>>
       where Self: Sized + Message { ... }
    unsafe fn setTargetItem(&self, target_item: Option<&AnyObject>)
       where Self: Sized + Message { ... }
    unsafe fn locationInView(&self, view: Option<&UIView>) -> CGPoint
       where Self: Sized + Message { ... }
}
Available on crate feature UISpringLoadedInteraction only.
Expand description

UISpringLoadedContext supplies information about the springloading state and current drag.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn state(&self) -> UISpringLoadedInteractionEffectState
where Self: Sized + Message,

The state that describes the current springloading style.

Source

unsafe fn targetView(&self) -> Option<Retained<UIView>>
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.

The view to which the interaction effect is applied. Defaults to the interaction’s view.

Source

unsafe fn setTargetView(&self, target_view: Option<&UIView>)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.

Setter for targetView.

Source

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

The targetItem allows to distinguish a region of the view on which the interaction is installed. It is convenient to set this property to a model object associated to targetView.

Source

unsafe fn setTargetItem(&self, target_item: Option<&AnyObject>)
where Self: Sized + Message,

Setter for targetItem.

Source

unsafe fn locationInView(&self, view: Option<&UIView>) -> CGPoint
where Self: Sized + Message,

Available on crate features UIResponder and UIView and objc2-core-foundation only.

Returns the point computed as the location of the current drag in a given view.

Parameter view: A view on which the drag is taking place. Specify nil to indicate the window.

Returns: A point in the local coordinate system of view.

Trait Implementations§

Source§

impl ProtocolType for dyn UISpringLoadedInteractionContext

Source§

const NAME: &'static str = "UISpringLoadedInteractionContext"

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 UISpringLoadedInteractionContext

Implementations on Foreign Types§

Source§

impl<T> UISpringLoadedInteractionContext for ProtocolObject<T>

Implementors§