objc2_ui_kit/generated/
UISnapBehavior.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11extern_class!(
12 #[unsafe(super(UIDynamicBehavior, NSObject))]
14 #[thread_kind = MainThreadOnly]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(feature = "UIDynamicBehavior")]
17 pub struct UISnapBehavior;
18);
19
20#[cfg(feature = "UIDynamicBehavior")]
21unsafe impl NSObjectProtocol for UISnapBehavior {}
22
23#[cfg(feature = "UIDynamicBehavior")]
24impl UISnapBehavior {
25 extern_methods!(
26 #[cfg(feature = "objc2-core-foundation")]
27 #[unsafe(method(initWithItem:snapToPoint:))]
28 #[unsafe(method_family = init)]
29 pub unsafe fn initWithItem_snapToPoint(
30 this: Allocated<Self>,
31 item: &ProtocolObject<dyn UIDynamicItem>,
32 point: CGPoint,
33 ) -> Retained<Self>;
34
35 #[cfg(feature = "objc2-core-foundation")]
36 #[unsafe(method(snapPoint))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn snapPoint(&self) -> CGPoint;
39
40 #[cfg(feature = "objc2-core-foundation")]
41 #[unsafe(method(setSnapPoint:))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn setSnapPoint(&self, snap_point: CGPoint);
45
46 #[cfg(feature = "objc2-core-foundation")]
47 #[unsafe(method(damping))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn damping(&self) -> CGFloat;
50
51 #[cfg(feature = "objc2-core-foundation")]
52 #[unsafe(method(setDamping:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn setDamping(&self, damping: CGFloat);
56 );
57}
58
59#[cfg(feature = "UIDynamicBehavior")]
61impl UISnapBehavior {
62 extern_methods!(
63 #[unsafe(method(init))]
64 #[unsafe(method_family = init)]
65 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67 #[unsafe(method(new))]
68 #[unsafe(method_family = new)]
69 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
70 );
71}