objc2_ui_kit/generated/
UIFeedbackGenerator.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uifeedbackgenerator?language=objc)
11    #[unsafe(super(NSObject))]
12    #[thread_kind = MainThreadOnly]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct UIFeedbackGenerator;
15);
16
17unsafe impl NSObjectProtocol for UIFeedbackGenerator {}
18
19impl UIFeedbackGenerator {
20    extern_methods!(
21        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
22        /// initalize the generator with a view to attach it to the provided view as an interaction.
23        #[unsafe(method(feedbackGeneratorForView:))]
24        #[unsafe(method_family = none)]
25        pub unsafe fn feedbackGeneratorForView(view: &UIView) -> Retained<Self>;
26
27        #[deprecated]
28        #[unsafe(method(init))]
29        #[unsafe(method_family = init)]
30        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
31
32        /// informs self that it will likely receive events soon, so that it can ensure minimal latency for any feedback generated
33        /// safe to call more than once before the generator receives an event, if events are still imminently possible
34        #[unsafe(method(prepare))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn prepare(&self);
37    );
38}
39
40/// Methods declared on superclass `NSObject`.
41impl UIFeedbackGenerator {
42    extern_methods!(
43        #[unsafe(method(new))]
44        #[unsafe(method_family = new)]
45        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
46    );
47}
48
49impl UIFeedbackGenerator {
50    extern_methods!();
51}
52
53#[cfg(feature = "UIInteraction")]
54unsafe impl UIInteraction for UIFeedbackGenerator {}