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")]
21extern_conformance!(
22 unsafe impl NSObjectProtocol for UISnapBehavior {}
23);
24
25#[cfg(feature = "UIDynamicBehavior")]
26impl UISnapBehavior {
27 extern_methods!(
28 #[cfg(feature = "objc2-core-foundation")]
29 #[unsafe(method(initWithItem:snapToPoint:))]
30 #[unsafe(method_family = init)]
31 pub fn initWithItem_snapToPoint(
32 this: Allocated<Self>,
33 item: &ProtocolObject<dyn UIDynamicItem>,
34 point: CGPoint,
35 ) -> Retained<Self>;
36
37 #[cfg(feature = "objc2-core-foundation")]
38 #[unsafe(method(snapPoint))]
39 #[unsafe(method_family = none)]
40 pub fn snapPoint(&self) -> CGPoint;
41
42 #[cfg(feature = "objc2-core-foundation")]
43 #[unsafe(method(setSnapPoint:))]
45 #[unsafe(method_family = none)]
46 pub fn setSnapPoint(&self, snap_point: CGPoint);
47
48 #[cfg(feature = "objc2-core-foundation")]
49 #[unsafe(method(damping))]
50 #[unsafe(method_family = none)]
51 pub fn damping(&self) -> CGFloat;
52
53 #[cfg(feature = "objc2-core-foundation")]
54 #[unsafe(method(setDamping:))]
56 #[unsafe(method_family = none)]
57 pub fn setDamping(&self, damping: CGFloat);
58 );
59}
60
61#[cfg(feature = "UIDynamicBehavior")]
63impl UISnapBehavior {
64 extern_methods!(
65 #[unsafe(method(init))]
66 #[unsafe(method_family = init)]
67 pub fn init(this: Allocated<Self>) -> Retained<Self>;
68
69 #[unsafe(method(new))]
70 #[unsafe(method_family = new)]
71 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
72 );
73}