objc2_ui_kit/generated/
UIScrollEdgeElementContainerInteraction.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    /// Add this interaction to a container view of views that overlay the edge of a scroll view.
11    /// Any descendants of this view that should affect the shape of the edge effect, such as labels, images, glass views, and controls, will automatically do so.
12    ///
13    /// In the following example, an interaction is added to a container view of buttons that overlay the bottom edge of a scroll view.
14    ///
15    /// let interaction = UIScrollEdgeElementContainerInteraction()
16    /// interaction.scrollView = scrollView
17    /// interaction.edge = .bottom
18    /// buttonContainer.addInteraction(interaction)
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscrolledgeelementcontainerinteraction?language=objc)
21    #[unsafe(super(NSObject))]
22    #[thread_kind = MainThreadOnly]
23    #[derive(Debug, PartialEq, Eq, Hash)]
24    pub struct UIScrollEdgeElementContainerInteraction;
25);
26
27extern_conformance!(
28    unsafe impl NSObjectProtocol for UIScrollEdgeElementContainerInteraction {}
29);
30
31#[cfg(feature = "UIInteraction")]
32extern_conformance!(
33    unsafe impl UIInteraction for UIScrollEdgeElementContainerInteraction {}
34);
35
36impl UIScrollEdgeElementContainerInteraction {
37    extern_methods!(
38        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
39        /// The scroll view to affect
40        #[unsafe(method(scrollView))]
41        #[unsafe(method_family = none)]
42        pub fn scrollView(&self) -> Option<Retained<UIScrollView>>;
43
44        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
45        /// Setter for [`scrollView`][Self::scrollView].
46        ///
47        /// This is a [weak property][objc2::topics::weak_property].
48        #[unsafe(method(setScrollView:))]
49        #[unsafe(method_family = none)]
50        pub fn setScrollView(&self, scroll_view: Option<&UIScrollView>);
51
52        #[cfg(feature = "UIGeometry")]
53        /// The edge of the scroll view to affect
54        #[unsafe(method(edge))]
55        #[unsafe(method_family = none)]
56        pub fn edge(&self) -> UIRectEdge;
57
58        #[cfg(feature = "UIGeometry")]
59        /// Setter for [`edge`][Self::edge].
60        #[unsafe(method(setEdge:))]
61        #[unsafe(method_family = none)]
62        pub fn setEdge(&self, edge: UIRectEdge);
63    );
64}
65
66/// Methods declared on superclass `NSObject`.
67impl UIScrollEdgeElementContainerInteraction {
68    extern_methods!(
69        #[unsafe(method(init))]
70        #[unsafe(method_family = init)]
71        pub fn init(this: Allocated<Self>) -> Retained<Self>;
72
73        #[unsafe(method(new))]
74        #[unsafe(method_family = new)]
75        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
76    );
77}