objc2_ui_kit/generated/
UIInteraction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait UIInteraction: NSObjectProtocol + MainThreadOnly {
13 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
14 #[unsafe(method(view))]
15 #[unsafe(method_family = none)]
16 unsafe fn view(&self) -> Option<Retained<UIView>>;
17
18 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
19 #[unsafe(method(willMoveToView:))]
20 #[unsafe(method_family = none)]
21 unsafe fn willMoveToView(&self, view: Option<&UIView>);
22
23 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
24 #[unsafe(method(didMoveToView:))]
25 #[unsafe(method_family = none)]
26 unsafe fn didMoveToView(&self, view: Option<&UIView>);
27 }
28);
29
30#[cfg(all(feature = "UIResponder", feature = "UIView"))]
32impl UIView {
33 extern_methods!(
34 #[unsafe(method(addInteraction:))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn addInteraction(&self, interaction: &ProtocolObject<dyn UIInteraction>);
37
38 #[unsafe(method(removeInteraction:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn removeInteraction(&self, interaction: &ProtocolObject<dyn UIInteraction>);
41
42 #[unsafe(method(interactions))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn interactions(&self) -> Retained<NSArray<ProtocolObject<dyn UIInteraction>>>;
45
46 #[unsafe(method(setInteractions:))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn setInteractions(
50 &self,
51 interactions: &NSArray<ProtocolObject<dyn UIInteraction>>,
52 );
53 );
54}