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
17extern_conformance!(
18    unsafe impl NSObjectProtocol for UIFeedbackGenerator {}
19);
20
21impl UIFeedbackGenerator {
22    extern_methods!(
23        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
24        /// initalize the generator with a view to attach it to the provided view as an interaction.
25        #[unsafe(method(feedbackGeneratorForView:))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn feedbackGeneratorForView(view: &UIView) -> Retained<Self>;
28
29        #[deprecated]
30        #[unsafe(method(init))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34        /// informs self that it will likely receive events soon, so that it can ensure minimal latency for any feedback generated
35        /// safe to call more than once before the generator receives an event, if events are still imminently possible
36        #[unsafe(method(prepare))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn prepare(&self);
39    );
40}
41
42/// Methods declared on superclass `NSObject`.
43impl UIFeedbackGenerator {
44    extern_methods!(
45        #[unsafe(method(new))]
46        #[unsafe(method_family = new)]
47        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
48    );
49}
50
51impl UIFeedbackGenerator {
52    extern_methods!();
53}
54
55#[cfg(feature = "UIInteraction")]
56extern_conformance!(
57    unsafe impl UIInteraction for UIFeedbackGenerator {}
58);