//! 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 objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinteraction?language=objc)
    pub unsafe trait UIInteraction: NSObjectProtocol + MainThreadOnly {
        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[unsafe(method(view))]
        #[unsafe(method_family = none)]
        fn view(&self) -> Option<Retained<UIView>>;

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[unsafe(method(willMoveToView:))]
        #[unsafe(method_family = none)]
        fn willMoveToView(&self, view: Option<&UIView>);

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[unsafe(method(didMoveToView:))]
        #[unsafe(method_family = none)]
        fn didMoveToView(&self, view: Option<&UIView>);
    }
);

/// Interactions.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIView {
    extern_methods!(
        #[unsafe(method(addInteraction:))]
        #[unsafe(method_family = none)]
        pub fn addInteraction(&self, interaction: &ProtocolObject<dyn UIInteraction>);

        #[unsafe(method(removeInteraction:))]
        #[unsafe(method_family = none)]
        pub fn removeInteraction(&self, interaction: &ProtocolObject<dyn UIInteraction>);

        #[unsafe(method(interactions))]
        #[unsafe(method_family = none)]
        pub fn interactions(&self) -> Retained<NSArray<ProtocolObject<dyn UIInteraction>>>;

        /// Setter for [`interactions`][Self::interactions].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setInteractions:))]
        #[unsafe(method_family = none)]
        pub fn setInteractions(&self, interactions: &NSArray<ProtocolObject<dyn UIInteraction>>);
    );
}
