//! 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerdisplaymode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerDisplayMode(pub NSInteger);
impl UISplitViewControllerDisplayMode {
    #[doc(alias = "UISplitViewControllerDisplayModeAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "UISplitViewControllerDisplayModeSecondaryOnly")]
    pub const SecondaryOnly: Self = Self(1);
    #[doc(alias = "UISplitViewControllerDisplayModeOneBesideSecondary")]
    pub const OneBesideSecondary: Self = Self(2);
    #[doc(alias = "UISplitViewControllerDisplayModeOneOverSecondary")]
    pub const OneOverSecondary: Self = Self(3);
    #[doc(alias = "UISplitViewControllerDisplayModeTwoBesideSecondary")]
    pub const TwoBesideSecondary: Self = Self(4);
    #[doc(alias = "UISplitViewControllerDisplayModeTwoOverSecondary")]
    pub const TwoOverSecondary: Self = Self(5);
    #[doc(alias = "UISplitViewControllerDisplayModeTwoDisplaceSecondary")]
    pub const TwoDisplaceSecondary: Self = Self(6);
    #[doc(alias = "UISplitViewControllerDisplayModePrimaryHidden")]
    #[deprecated]
    pub const PrimaryHidden: Self = Self(UISplitViewControllerDisplayMode::SecondaryOnly.0);
    #[doc(alias = "UISplitViewControllerDisplayModeAllVisible")]
    #[deprecated]
    pub const AllVisible: Self = Self(UISplitViewControllerDisplayMode::OneBesideSecondary.0);
    #[doc(alias = "UISplitViewControllerDisplayModePrimaryOverlay")]
    #[deprecated]
    pub const PrimaryOverlay: Self = Self(UISplitViewControllerDisplayMode::OneOverSecondary.0);
}

unsafe impl Encode for UISplitViewControllerDisplayMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UISplitViewControllerDisplayMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerprimaryedge?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerPrimaryEdge(pub NSInteger);
impl UISplitViewControllerPrimaryEdge {
    #[doc(alias = "UISplitViewControllerPrimaryEdgeLeading")]
    pub const Leading: Self = Self(0);
    #[doc(alias = "UISplitViewControllerPrimaryEdgeTrailing")]
    pub const Trailing: Self = Self(1);
}

unsafe impl Encode for UISplitViewControllerPrimaryEdge {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UISplitViewControllerPrimaryEdge {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerbackgroundstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerBackgroundStyle(pub NSInteger);
impl UISplitViewControllerBackgroundStyle {
    #[doc(alias = "UISplitViewControllerBackgroundStyleNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "UISplitViewControllerBackgroundStyleSidebar")]
    pub const Sidebar: Self = Self(1);
}

unsafe impl Encode for UISplitViewControllerBackgroundStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UISplitViewControllerBackgroundStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerStyle(pub NSInteger);
impl UISplitViewControllerStyle {
    #[doc(alias = "UISplitViewControllerStyleUnspecified")]
    #[deprecated]
    pub const Unspecified: Self = Self(0);
    #[doc(alias = "UISplitViewControllerStyleDoubleColumn")]
    pub const DoubleColumn: Self = Self(1);
    #[doc(alias = "UISplitViewControllerStyleTripleColumn")]
    pub const TripleColumn: Self = Self(2);
}

unsafe impl Encode for UISplitViewControllerStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UISplitViewControllerStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollercolumn?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerColumn(pub NSInteger);
impl UISplitViewControllerColumn {
    #[doc(alias = "UISplitViewControllerColumnPrimary")]
    pub const Primary: Self = Self(0);
    #[doc(alias = "UISplitViewControllerColumnSupplementary")]
    pub const Supplementary: Self = Self(1);
    #[doc(alias = "UISplitViewControllerColumnSecondary")]
    pub const Secondary: Self = Self(2);
    #[doc(alias = "UISplitViewControllerColumnCompact")]
    pub const Compact: Self = Self(3);
    #[doc(alias = "UISplitViewControllerColumnInspector")]
    pub const Inspector: Self = Self(4);
}

unsafe impl Encode for UISplitViewControllerColumn {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UISplitViewControllerColumn {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollersplitbehavior?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerSplitBehavior(pub NSInteger);
impl UISplitViewControllerSplitBehavior {
    #[doc(alias = "UISplitViewControllerSplitBehaviorAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "UISplitViewControllerSplitBehaviorTile")]
    pub const Tile: Self = Self(1);
    #[doc(alias = "UISplitViewControllerSplitBehaviorOverlay")]
    pub const Overlay: Self = Self(2);
    #[doc(alias = "UISplitViewControllerSplitBehaviorDisplace")]
    pub const Displace: Self = Self(3);
}

unsafe impl Encode for UISplitViewControllerSplitBehavior {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UISplitViewControllerSplitBehavior {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerdisplaymodebuttonvisibility?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerDisplayModeButtonVisibility(pub NSInteger);
impl UISplitViewControllerDisplayModeButtonVisibility {
    #[doc(alias = "UISplitViewControllerDisplayModeButtonVisibilityAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "UISplitViewControllerDisplayModeButtonVisibilityNever")]
    pub const Never: Self = Self(1);
    #[doc(alias = "UISplitViewControllerDisplayModeButtonVisibilityAlways")]
    pub const Always: Self = Self(2);
}

unsafe impl Encode for UISplitViewControllerDisplayModeButtonVisibility {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UISplitViewControllerDisplayModeButtonVisibility {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerautomaticdimension?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static UISplitViewControllerAutomaticDimension: CGFloat;
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontroller?language=objc)
    #[unsafe(super(UIViewController, UIResponder, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
    pub struct UISplitViewController;
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl NSCoding for UISplitViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UISplitViewController {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UISplitViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl UIContentContainer for UISplitViewController {}
);

#[cfg(all(
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UISplitViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UISplitViewController {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UISplitViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UISplitViewController {
    extern_methods!(
        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSString>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithStyle:))]
        #[unsafe(method_family = init)]
        pub fn initWithStyle(
            this: Allocated<Self>,
            style: UISplitViewControllerStyle,
        ) -> Retained<Self>;

        #[unsafe(method(style))]
        #[unsafe(method_family = none)]
        pub fn style(&self) -> UISplitViewControllerStyle;

        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UISplitViewControllerDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn UISplitViewControllerDelegate>>,
        );

        #[unsafe(method(showsSecondaryOnlyButton))]
        #[unsafe(method_family = none)]
        pub fn showsSecondaryOnlyButton(&self) -> bool;

        /// Setter for [`showsSecondaryOnlyButton`][Self::showsSecondaryOnlyButton].
        #[unsafe(method(setShowsSecondaryOnlyButton:))]
        #[unsafe(method_family = none)]
        pub fn setShowsSecondaryOnlyButton(&self, shows_secondary_only_button: bool);

        #[unsafe(method(preferredSplitBehavior))]
        #[unsafe(method_family = none)]
        pub fn preferredSplitBehavior(&self) -> UISplitViewControllerSplitBehavior;

        /// Setter for [`preferredSplitBehavior`][Self::preferredSplitBehavior].
        #[unsafe(method(setPreferredSplitBehavior:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredSplitBehavior(
            &self,
            preferred_split_behavior: UISplitViewControllerSplitBehavior,
        );

        #[unsafe(method(splitBehavior))]
        #[unsafe(method_family = none)]
        pub fn splitBehavior(&self) -> UISplitViewControllerSplitBehavior;

        #[unsafe(method(setViewController:forColumn:))]
        #[unsafe(method_family = none)]
        pub fn setViewController_forColumn(
            &self,
            vc: Option<&UIViewController>,
            column: UISplitViewControllerColumn,
        );

        #[unsafe(method(viewControllerForColumn:))]
        #[unsafe(method_family = none)]
        pub fn viewControllerForColumn(
            &self,
            column: UISplitViewControllerColumn,
        ) -> Option<Retained<UIViewController>>;

        #[unsafe(method(hideColumn:))]
        #[unsafe(method_family = none)]
        pub fn hideColumn(&self, column: UISplitViewControllerColumn);

        #[unsafe(method(showColumn:))]
        #[unsafe(method_family = none)]
        pub fn showColumn(&self, column: UISplitViewControllerColumn);

        #[unsafe(method(isShowingColumn:))]
        #[unsafe(method_family = none)]
        pub fn isShowingColumn(&self, column: UISplitViewControllerColumn) -> bool;

        #[unsafe(method(viewControllers))]
        #[unsafe(method_family = none)]
        pub fn viewControllers(&self) -> Retained<NSArray<UIViewController>>;

        /// Setter for [`viewControllers`][Self::viewControllers].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setViewControllers:))]
        #[unsafe(method_family = none)]
        pub fn setViewControllers(&self, view_controllers: &NSArray<UIViewController>);

        #[unsafe(method(presentsWithGesture))]
        #[unsafe(method_family = none)]
        pub fn presentsWithGesture(&self) -> bool;

        /// Setter for [`presentsWithGesture`][Self::presentsWithGesture].
        #[unsafe(method(setPresentsWithGesture:))]
        #[unsafe(method_family = none)]
        pub fn setPresentsWithGesture(&self, presents_with_gesture: bool);

        #[unsafe(method(isCollapsed))]
        #[unsafe(method_family = none)]
        pub fn isCollapsed(&self) -> bool;

        #[unsafe(method(preferredDisplayMode))]
        #[unsafe(method_family = none)]
        pub fn preferredDisplayMode(&self) -> UISplitViewControllerDisplayMode;

        /// Setter for [`preferredDisplayMode`][Self::preferredDisplayMode].
        #[unsafe(method(setPreferredDisplayMode:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredDisplayMode(
            &self,
            preferred_display_mode: UISplitViewControllerDisplayMode,
        );

        #[unsafe(method(displayMode))]
        #[unsafe(method_family = none)]
        pub fn displayMode(&self) -> UISplitViewControllerDisplayMode;

        #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
        #[unsafe(method(displayModeButtonItem))]
        #[unsafe(method_family = none)]
        pub fn displayModeButtonItem(&self) -> Retained<UIBarButtonItem>;

        #[unsafe(method(displayModeButtonVisibility))]
        #[unsafe(method_family = none)]
        pub fn displayModeButtonVisibility(
            &self,
        ) -> UISplitViewControllerDisplayModeButtonVisibility;

        /// Setter for [`displayModeButtonVisibility`][Self::displayModeButtonVisibility].
        #[unsafe(method(setDisplayModeButtonVisibility:))]
        #[unsafe(method_family = none)]
        pub fn setDisplayModeButtonVisibility(
            &self,
            display_mode_button_visibility: UISplitViewControllerDisplayModeButtonVisibility,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredPrimaryColumnWidthFraction))]
        #[unsafe(method_family = none)]
        pub fn preferredPrimaryColumnWidthFraction(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredPrimaryColumnWidthFraction`][Self::preferredPrimaryColumnWidthFraction].
        #[unsafe(method(setPreferredPrimaryColumnWidthFraction:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredPrimaryColumnWidthFraction(
            &self,
            preferred_primary_column_width_fraction: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredPrimaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn preferredPrimaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredPrimaryColumnWidth`][Self::preferredPrimaryColumnWidth].
        #[unsafe(method(setPreferredPrimaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredPrimaryColumnWidth(&self, preferred_primary_column_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(minimumPrimaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn minimumPrimaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`minimumPrimaryColumnWidth`][Self::minimumPrimaryColumnWidth].
        #[unsafe(method(setMinimumPrimaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumPrimaryColumnWidth(&self, minimum_primary_column_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(maximumPrimaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn maximumPrimaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`maximumPrimaryColumnWidth`][Self::maximumPrimaryColumnWidth].
        #[unsafe(method(setMaximumPrimaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setMaximumPrimaryColumnWidth(&self, maximum_primary_column_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(primaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn primaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredSupplementaryColumnWidthFraction))]
        #[unsafe(method_family = none)]
        pub fn preferredSupplementaryColumnWidthFraction(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredSupplementaryColumnWidthFraction`][Self::preferredSupplementaryColumnWidthFraction].
        #[unsafe(method(setPreferredSupplementaryColumnWidthFraction:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredSupplementaryColumnWidthFraction(
            &self,
            preferred_supplementary_column_width_fraction: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredSupplementaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn preferredSupplementaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredSupplementaryColumnWidth`][Self::preferredSupplementaryColumnWidth].
        #[unsafe(method(setPreferredSupplementaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredSupplementaryColumnWidth(
            &self,
            preferred_supplementary_column_width: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(minimumSupplementaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn minimumSupplementaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`minimumSupplementaryColumnWidth`][Self::minimumSupplementaryColumnWidth].
        #[unsafe(method(setMinimumSupplementaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumSupplementaryColumnWidth(
            &self,
            minimum_supplementary_column_width: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(maximumSupplementaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn maximumSupplementaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`maximumSupplementaryColumnWidth`][Self::maximumSupplementaryColumnWidth].
        #[unsafe(method(setMaximumSupplementaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setMaximumSupplementaryColumnWidth(
            &self,
            maximum_supplementary_column_width: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(supplementaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn supplementaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredSecondaryColumnWidthFraction))]
        #[unsafe(method_family = none)]
        pub fn preferredSecondaryColumnWidthFraction(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredSecondaryColumnWidthFraction`][Self::preferredSecondaryColumnWidthFraction].
        #[unsafe(method(setPreferredSecondaryColumnWidthFraction:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredSecondaryColumnWidthFraction(
            &self,
            preferred_secondary_column_width_fraction: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredSecondaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn preferredSecondaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredSecondaryColumnWidth`][Self::preferredSecondaryColumnWidth].
        #[unsafe(method(setPreferredSecondaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredSecondaryColumnWidth(&self, preferred_secondary_column_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(minimumSecondaryColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn minimumSecondaryColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`minimumSecondaryColumnWidth`][Self::minimumSecondaryColumnWidth].
        #[unsafe(method(setMinimumSecondaryColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumSecondaryColumnWidth(&self, minimum_secondary_column_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredInspectorColumnWidthFraction))]
        #[unsafe(method_family = none)]
        pub fn preferredInspectorColumnWidthFraction(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredInspectorColumnWidthFraction`][Self::preferredInspectorColumnWidthFraction].
        #[unsafe(method(setPreferredInspectorColumnWidthFraction:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredInspectorColumnWidthFraction(
            &self,
            preferred_inspector_column_width_fraction: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(preferredInspectorColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn preferredInspectorColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredInspectorColumnWidth`][Self::preferredInspectorColumnWidth].
        #[unsafe(method(setPreferredInspectorColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredInspectorColumnWidth(&self, preferred_inspector_column_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(minimumInspectorColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn minimumInspectorColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`minimumInspectorColumnWidth`][Self::minimumInspectorColumnWidth].
        #[unsafe(method(setMinimumInspectorColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumInspectorColumnWidth(&self, minimum_inspector_column_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(maximumInspectorColumnWidth))]
        #[unsafe(method_family = none)]
        pub fn maximumInspectorColumnWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`maximumInspectorColumnWidth`][Self::maximumInspectorColumnWidth].
        #[unsafe(method(setMaximumInspectorColumnWidth:))]
        #[unsafe(method_family = none)]
        pub fn setMaximumInspectorColumnWidth(&self, maximum_inspector_column_width: CGFloat);

        #[unsafe(method(primaryEdge))]
        #[unsafe(method_family = none)]
        pub fn primaryEdge(&self) -> UISplitViewControllerPrimaryEdge;

        /// Setter for [`primaryEdge`][Self::primaryEdge].
        #[unsafe(method(setPrimaryEdge:))]
        #[unsafe(method_family = none)]
        pub fn setPrimaryEdge(&self, primary_edge: UISplitViewControllerPrimaryEdge);

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[unsafe(method(showViewController:sender:))]
        #[unsafe(method_family = none)]
        pub unsafe fn showViewController_sender(
            &self,
            vc: &UIViewController,
            sender: Option<&AnyObject>,
        );

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[unsafe(method(showDetailViewController:sender:))]
        #[unsafe(method_family = none)]
        pub unsafe fn showDetailViewController_sender(
            &self,
            vc: &UIViewController,
            sender: Option<&AnyObject>,
        );

        #[unsafe(method(primaryBackgroundStyle))]
        #[unsafe(method_family = none)]
        pub fn primaryBackgroundStyle(&self) -> UISplitViewControllerBackgroundStyle;

        /// Setter for [`primaryBackgroundStyle`][Self::primaryBackgroundStyle].
        #[unsafe(method(setPrimaryBackgroundStyle:))]
        #[unsafe(method_family = none)]
        pub fn setPrimaryBackgroundStyle(
            &self,
            primary_background_style: UISplitViewControllerBackgroundStyle,
        );
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UISplitViewController {
    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>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerdelegate?language=objc)
    pub unsafe trait UISplitViewControllerDelegate: MainThreadOnly {
        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:willChangeToDisplayMode:))]
        #[unsafe(method_family = none)]
        fn splitViewController_willChangeToDisplayMode(
            &self,
            svc: &UISplitViewController,
            display_mode: UISplitViewControllerDisplayMode,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(targetDisplayModeForActionInSplitViewController:))]
        #[unsafe(method_family = none)]
        fn targetDisplayModeForActionInSplitViewController(
            &self,
            svc: &UISplitViewController,
        ) -> UISplitViewControllerDisplayMode;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[optional]
        #[unsafe(method(splitViewController:showViewController:sender:))]
        #[unsafe(method_family = none)]
        unsafe fn splitViewController_showViewController_sender(
            &self,
            split_view_controller: &UISplitViewController,
            vc: &UIViewController,
            sender: Option<&AnyObject>,
        ) -> bool;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[optional]
        #[unsafe(method(splitViewController:showDetailViewController:sender:))]
        #[unsafe(method_family = none)]
        unsafe fn splitViewController_showDetailViewController_sender(
            &self,
            split_view_controller: &UISplitViewController,
            vc: &UIViewController,
            sender: Option<&AnyObject>,
        ) -> bool;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(primaryViewControllerForCollapsingSplitViewController:))]
        #[unsafe(method_family = none)]
        fn primaryViewControllerForCollapsingSplitViewController(
            &self,
            split_view_controller: &UISplitViewController,
        ) -> Option<Retained<UIViewController>>;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(primaryViewControllerForExpandingSplitViewController:))]
        #[unsafe(method_family = none)]
        fn primaryViewControllerForExpandingSplitViewController(
            &self,
            split_view_controller: &UISplitViewController,
        ) -> Option<Retained<UIViewController>>;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:collapseSecondaryViewController:ontoPrimaryViewController:))]
        #[unsafe(method_family = none)]
        fn splitViewController_collapseSecondaryViewController_ontoPrimaryViewController(
            &self,
            split_view_controller: &UISplitViewController,
            secondary_view_controller: &UIViewController,
            primary_view_controller: &UIViewController,
        ) -> bool;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:separateSecondaryViewControllerFromPrimaryViewController:))]
        #[unsafe(method_family = none)]
        fn splitViewController_separateSecondaryViewControllerFromPrimaryViewController(
            &self,
            split_view_controller: &UISplitViewController,
            primary_view_controller: &UIViewController,
        ) -> Option<Retained<UIViewController>>;

        #[cfg(all(
            feature = "UIOrientation",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[optional]
        #[unsafe(method(splitViewControllerSupportedInterfaceOrientations:))]
        #[unsafe(method_family = none)]
        fn splitViewControllerSupportedInterfaceOrientations(
            &self,
            split_view_controller: &UISplitViewController,
        ) -> UIInterfaceOrientationMask;

        #[cfg(all(
            feature = "UIOrientation",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[optional]
        #[unsafe(method(splitViewControllerPreferredInterfaceOrientationForPresentation:))]
        #[unsafe(method_family = none)]
        fn splitViewControllerPreferredInterfaceOrientationForPresentation(
            &self,
            split_view_controller: &UISplitViewController,
        ) -> UIInterfaceOrientation;

        #[cfg(all(
            feature = "UIBarButtonItem",
            feature = "UIBarItem",
            feature = "UIPopoverController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[deprecated = "Use splitViewController:willChangeToDisplayMode: and displayModeButtonItem instead"]
        #[optional]
        #[unsafe(method(splitViewController:willHideViewController:withBarButtonItem:forPopoverController:))]
        #[unsafe(method_family = none)]
        fn splitViewController_willHideViewController_withBarButtonItem_forPopoverController(
            &self,
            svc: &UISplitViewController,
            a_view_controller: &UIViewController,
            bar_button_item: &UIBarButtonItem,
            pc: &UIPopoverController,
        );

        #[cfg(all(
            feature = "UIBarButtonItem",
            feature = "UIBarItem",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[deprecated = "Use splitViewController:willChangeToDisplayMode: and displayModeButtonItem instead"]
        #[optional]
        #[unsafe(method(splitViewController:willShowViewController:invalidatingBarButtonItem:))]
        #[unsafe(method_family = none)]
        fn splitViewController_willShowViewController_invalidatingBarButtonItem(
            &self,
            svc: &UISplitViewController,
            a_view_controller: &UIViewController,
            bar_button_item: &UIBarButtonItem,
        );

        #[cfg(all(
            feature = "UIPopoverController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(splitViewController:popoverController:willPresentViewController:))]
        #[unsafe(method_family = none)]
        fn splitViewController_popoverController_willPresentViewController(
            &self,
            svc: &UISplitViewController,
            pc: &UIPopoverController,
            a_view_controller: &UIViewController,
        );

        #[cfg(all(
            feature = "UIOrientation",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(splitViewController:shouldHideViewController:inOrientation:))]
        #[unsafe(method_family = none)]
        fn splitViewController_shouldHideViewController_inOrientation(
            &self,
            svc: &UISplitViewController,
            vc: &UIViewController,
            orientation: UIInterfaceOrientation,
        ) -> bool;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:topColumnForCollapsingToProposedTopColumn:))]
        #[unsafe(method_family = none)]
        fn splitViewController_topColumnForCollapsingToProposedTopColumn(
            &self,
            svc: &UISplitViewController,
            proposed_top_column: UISplitViewControllerColumn,
        ) -> UISplitViewControllerColumn;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:displayModeForExpandingToProposedDisplayMode:))]
        #[unsafe(method_family = none)]
        fn splitViewController_displayModeForExpandingToProposedDisplayMode(
            &self,
            svc: &UISplitViewController,
            proposed_display_mode: UISplitViewControllerDisplayMode,
        ) -> UISplitViewControllerDisplayMode;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewControllerDidCollapse:))]
        #[unsafe(method_family = none)]
        fn splitViewControllerDidCollapse(&self, svc: &UISplitViewController);

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewControllerDidExpand:))]
        #[unsafe(method_family = none)]
        fn splitViewControllerDidExpand(&self, svc: &UISplitViewController);

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:willShowColumn:))]
        #[unsafe(method_family = none)]
        fn splitViewController_willShowColumn(
            &self,
            svc: &UISplitViewController,
            column: UISplitViewControllerColumn,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:willHideColumn:))]
        #[unsafe(method_family = none)]
        fn splitViewController_willHideColumn(
            &self,
            svc: &UISplitViewController,
            column: UISplitViewControllerColumn,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:didShowColumn:))]
        #[unsafe(method_family = none)]
        fn splitViewController_didShowColumn(
            &self,
            svc: &UISplitViewController,
            column: UISplitViewControllerColumn,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewController:didHideColumn:))]
        #[unsafe(method_family = none)]
        fn splitViewController_didHideColumn(
            &self,
            svc: &UISplitViewController,
            column: UISplitViewControllerColumn,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewControllerInteractivePresentationGestureWillBegin:))]
        #[unsafe(method_family = none)]
        fn splitViewControllerInteractivePresentationGestureWillBegin(
            &self,
            svc: &UISplitViewController,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(splitViewControllerInteractivePresentationGestureDidEnd:))]
        #[unsafe(method_family = none)]
        fn splitViewControllerInteractivePresentationGestureDidEnd(
            &self,
            svc: &UISplitViewController,
        );
    }
);

/// UISplitViewController.
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIViewController {
    extern_methods!(
        #[unsafe(method(splitViewController))]
        #[unsafe(method_family = none)]
        pub fn splitViewController(&self) -> Option<Retained<UISplitViewController>>;

        #[unsafe(method(collapseSecondaryViewController:forSplitViewController:))]
        #[unsafe(method_family = none)]
        pub fn collapseSecondaryViewController_forSplitViewController(
            &self,
            secondary_view_controller: &UIViewController,
            split_view_controller: &UISplitViewController,
        );

        #[unsafe(method(separateSecondaryViewControllerForSplitViewController:))]
        #[unsafe(method_family = none)]
        pub fn separateSecondaryViewControllerForSplitViewController(
            &self,
            split_view_controller: &UISplitViewController,
        ) -> Option<Retained<UIViewController>>;
    );
}
