Skip to main content

UISpringLoadedInteractionContext

Trait UISpringLoadedInteractionContext 

Source
pub unsafe trait UISpringLoadedInteractionContext: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    fn state(&self) -> UISpringLoadedInteractionEffectState
       where Self: Sized + Message { ... }
    fn targetView(&self) -> Option<Retained<UIView>>
       where Self: Sized + Message { ... }
    fn setTargetView(&self, target_view: Option<&UIView>)
       where Self: Sized + Message { ... }
    fn targetItem(&self) -> Option<Retained<AnyObject>>
       where Self: Sized + Message { ... }
    unsafe fn setTargetItem(&self, target_item: Option<&AnyObject>)
       where Self: Sized + Message { ... }
    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

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

The state that describes the current springloading style.

Source

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

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

Available on crate features UIResponder and UIView only.

Setter for targetView.

Source

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.

§Safety

target_item should be of the correct type.

Source

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

Available on crate features objc2-core-foundation and UIResponder and UIView 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<T> ImplementedBy<T> for dyn UISpringLoadedInteractionContext

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> UISpringLoadedInteractionContext for ProtocolObject<T>

Implementors§