//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uistoryboardviewcontrollercreator?language=objc)
#[cfg(all(
    feature = "UIResponder",
    feature = "UIViewController",
    feature = "block2"
))]
pub type UIStoryboardViewControllerCreator =
    *mut block2::DynBlock<dyn Fn(NonNull<NSCoder>) -> *mut UIViewController>;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uistoryboard?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
    pub struct UIStoryboard;
);

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

impl UIStoryboard {
    extern_methods!(
        #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
        #[unsafe(method(storyboardWithName:bundle:))]
        #[unsafe(method_family = none)]
        pub fn storyboardWithName_bundle(
            name: &NSString,
            storyboard_bundle_or_nil: Option<&NSBundle>,
            mtm: MainThreadMarker,
        ) -> Retained<UIStoryboard>;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
        #[unsafe(method(instantiateInitialViewController))]
        #[unsafe(method_family = none)]
        pub fn instantiateInitialViewController(&self) -> Option<Retained<UIViewController>>;

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIViewController",
            feature = "block2"
        ))]
        /// # Safety
        ///
        /// `block` must be a valid pointer or null.
        #[unsafe(method(instantiateInitialViewControllerWithCreator:))]
        #[unsafe(method_family = none)]
        pub unsafe fn instantiateInitialViewControllerWithCreator(
            &self,
            block: UIStoryboardViewControllerCreator,
        ) -> Option<Retained<UIViewController>>;

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
        #[unsafe(method(instantiateViewControllerWithIdentifier:))]
        #[unsafe(method_family = none)]
        pub fn instantiateViewControllerWithIdentifier(
            &self,
            identifier: &NSString,
        ) -> Retained<UIViewController>;

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIViewController",
            feature = "block2"
        ))]
        /// # Safety
        ///
        /// `block` must be a valid pointer or null.
        #[unsafe(method(instantiateViewControllerWithIdentifier:creator:))]
        #[unsafe(method_family = none)]
        pub unsafe fn instantiateViewControllerWithIdentifier_creator(
            &self,
            identifier: &NSString,
            block: UIStoryboardViewControllerCreator,
        ) -> Retained<UIViewController>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UIStoryboard {
    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>;
    );
}
