objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    /// Add this interaction to a container view of views that overlay the edge of a scroll view.
    /// 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.
    ///
    /// In the following example, an interaction is added to a container view of buttons that overlay the bottom edge of a scroll view.
    ///
    /// let interaction = UIScrollEdgeElementContainerInteraction()
    /// interaction.scrollView = scrollView
    /// interaction.edge = .bottom
    /// buttonContainer.addInteraction(interaction)
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscrolledgeelementcontainerinteraction?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIScrollEdgeElementContainerInteraction;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for UIScrollEdgeElementContainerInteraction {}
);

#[cfg(feature = "UIInteraction")]
extern_conformance!(
    unsafe impl UIInteraction for UIScrollEdgeElementContainerInteraction {}
);

impl UIScrollEdgeElementContainerInteraction {
    extern_methods!(
        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
        /// The scroll view to affect
        #[unsafe(method(scrollView))]
        #[unsafe(method_family = none)]
        pub fn scrollView(&self) -> Option<Retained<UIScrollView>>;

        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
        /// Setter for [`scrollView`][Self::scrollView].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setScrollView:))]
        #[unsafe(method_family = none)]
        pub fn setScrollView(&self, scroll_view: Option<&UIScrollView>);

        #[cfg(feature = "UIGeometry")]
        /// The edge of the scroll view to affect
        #[unsafe(method(edge))]
        #[unsafe(method_family = none)]
        pub fn edge(&self) -> UIRectEdge;

        #[cfg(feature = "UIGeometry")]
        /// Setter for [`edge`][Self::edge].
        #[unsafe(method(setEdge:))]
        #[unsafe(method_family = none)]
        pub fn setEdge(&self, edge: UIRectEdge);
    );
}

/// Methods declared on superclass `NSObject`.
impl UIScrollEdgeElementContainerInteraction {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}