objc2_ui_kit/generated/
UIInteraction.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinteraction?language=objc)
12    pub unsafe trait UIInteraction: NSObjectProtocol + MainThreadOnly {
13        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
14        #[unsafe(method(view))]
15        #[unsafe(method_family = none)]
16        fn view(&self) -> Option<Retained<UIView>>;
17
18        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
19        #[unsafe(method(willMoveToView:))]
20        #[unsafe(method_family = none)]
21        fn willMoveToView(&self, view: Option<&UIView>);
22
23        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
24        #[unsafe(method(didMoveToView:))]
25        #[unsafe(method_family = none)]
26        fn didMoveToView(&self, view: Option<&UIView>);
27    }
28);
29
30/// Interactions.
31#[cfg(all(feature = "UIResponder", feature = "UIView"))]
32impl UIView {
33    extern_methods!(
34        #[unsafe(method(addInteraction:))]
35        #[unsafe(method_family = none)]
36        pub fn addInteraction(&self, interaction: &ProtocolObject<dyn UIInteraction>);
37
38        #[unsafe(method(removeInteraction:))]
39        #[unsafe(method_family = none)]
40        pub fn removeInteraction(&self, interaction: &ProtocolObject<dyn UIInteraction>);
41
42        #[unsafe(method(interactions))]
43        #[unsafe(method_family = none)]
44        pub fn interactions(&self) -> Retained<NSArray<ProtocolObject<dyn UIInteraction>>>;
45
46        /// Setter for [`interactions`][Self::interactions].
47        ///
48        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
49        #[unsafe(method(setInteractions:))]
50        #[unsafe(method_family = none)]
51        pub fn setInteractions(&self, interactions: &NSArray<ProtocolObject<dyn UIInteraction>>);
52    );
53}