Trait BEDragInteractionDelegate

Source
pub unsafe trait BEDragInteractionDelegate: UIDragInteractionDelegate + MainThreadOnly {
    // Provided methods
    unsafe fn dragInteraction_prepareDragSession_completion(
        &self,
        drag_interaction: &BEDragInteraction,
        session: &ProtocolObject<dyn UIDragSession>,
        completion: &DynBlock<dyn Fn() -> Bool>,
    )
       where Self: Sized + Message { ... }
    unsafe fn dragInteraction_itemsForAddingToSession_forTouchAtPoint_completion(
        &self,
        drag_interaction: &BEDragInteraction,
        session: &ProtocolObject<dyn UIDragSession>,
        point: CGPoint,
        completion: &DynBlock<dyn Fn(NonNull<NSArray<UIDragItem>>) -> Bool>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature BEDragInteraction only.
Expand description

Provided Methods§

Source

unsafe fn dragInteraction_prepareDragSession_completion( &self, drag_interaction: &BEDragInteraction, session: &ProtocolObject<dyn UIDragSession>, completion: &DynBlock<dyn Fn() -> Bool>, )
where Self: Sized + Message,

Available on crate feature block2 only.

Called when the drag interaction has begun, to allow the delegate to prepare for the drag session before the system requests drag items through -dragInteraction:itemsForBeginningSession:.

You should call the completion block as soon as the drag session is prepared, as to minimize the delay from the user interaction from the drag gesture. There is a system-defined timeout before the drag session is failed if the completion is not called in time. The completion block returns YES if the drag session did prepare successfully prepare, and NO otherwise, to allow clients to perform any clean-up if necessary.

Source

unsafe fn dragInteraction_itemsForAddingToSession_forTouchAtPoint_completion( &self, drag_interaction: &BEDragInteraction, session: &ProtocolObject<dyn UIDragSession>, point: CGPoint, completion: &DynBlock<dyn Fn(NonNull<NSArray<UIDragItem>>) -> Bool>, )
where Self: Sized + Message,

Available on crate features block2 and objc2-core-foundation only.

The asynchronous counterpart to -dragInteraction:itemsForAddingToSession:withTouchAtPoint: to allow touches on this view to add items to an existing drag session. Please refer to the aforementioned delegate method for its full documentation.

If this method is implemented, then the UIDragInteractionDelegate counterpart method will no longer be called.

You should call the completion block as soon as the items are ready. There is a system-defined timeout before the system will treat the delegate call as returning an empty array. The completion block returns YES if the drag session did add items to the session successfully, and NO otherwise, to allow clients to perform any clean-up if necessary.

Trait Implementations§

Source§

impl ProtocolType for dyn BEDragInteractionDelegate

Source§

const NAME: &'static str = "BEDragInteractionDelegate"

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 BEDragInteractionDelegate

Implementations on Foreign Types§

Source§

impl<T> BEDragInteractionDelegate for ProtocolObject<T>

Implementors§