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::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIModalTransitionStyle(pub NSInteger);
impl UIModalTransitionStyle {
#[doc(alias = "UIModalTransitionStyleCoverVertical")]
pub const CoverVertical: Self = Self(0);
#[doc(alias = "UIModalTransitionStyleFlipHorizontal")]
pub const FlipHorizontal: Self = Self(1);
#[doc(alias = "UIModalTransitionStyleCrossDissolve")]
pub const CrossDissolve: Self = Self(2);
#[doc(alias = "UIModalTransitionStylePartialCurl")]
pub const PartialCurl: Self = Self(3);
}
unsafe impl Encode for UIModalTransitionStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIModalTransitionStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIModalPresentationStyle(pub NSInteger);
impl UIModalPresentationStyle {
#[doc(alias = "UIModalPresentationFullScreen")]
pub const FullScreen: Self = Self(0);
#[doc(alias = "UIModalPresentationPageSheet")]
pub const PageSheet: Self = Self(1);
#[doc(alias = "UIModalPresentationFormSheet")]
pub const FormSheet: Self = Self(2);
#[doc(alias = "UIModalPresentationCurrentContext")]
pub const CurrentContext: Self = Self(3);
#[doc(alias = "UIModalPresentationCustom")]
pub const Custom: Self = Self(4);
#[doc(alias = "UIModalPresentationOverFullScreen")]
pub const OverFullScreen: Self = Self(5);
#[doc(alias = "UIModalPresentationOverCurrentContext")]
pub const OverCurrentContext: Self = Self(6);
#[doc(alias = "UIModalPresentationPopover")]
pub const Popover: Self = Self(7);
#[doc(alias = "UIModalPresentationBlurOverFullScreen")]
pub const BlurOverFullScreen: Self = Self(8);
#[doc(alias = "UIModalPresentationNone")]
pub const None: Self = Self(-1);
#[doc(alias = "UIModalPresentationAutomatic")]
pub const Automatic: Self = Self(-2);
}
unsafe impl Encode for UIModalPresentationStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIModalPresentationStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait UIContentContainer: NSObjectProtocol + MainThreadOnly {
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(preferredContentSize))]
#[unsafe(method_family = none)]
fn preferredContentSize(&self) -> CGSize;
#[unsafe(method(preferredContentSizeDidChangeForChildContentContainer:))]
#[unsafe(method_family = none)]
fn preferredContentSizeDidChangeForChildContentContainer(
&self,
container: &ProtocolObject<dyn UIContentContainer>,
);
#[unsafe(method(systemLayoutFittingSizeDidChangeForChildContentContainer:))]
#[unsafe(method_family = none)]
fn systemLayoutFittingSizeDidChangeForChildContentContainer(
&self,
container: &ProtocolObject<dyn UIContentContainer>,
);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(sizeForChildContentContainer:withParentContainerSize:))]
#[unsafe(method_family = none)]
fn sizeForChildContentContainer_withParentContainerSize(
&self,
container: &ProtocolObject<dyn UIContentContainer>,
parent_size: CGSize,
) -> CGSize;
#[cfg(all(
feature = "UIViewControllerTransitionCoordinator",
feature = "objc2-core-foundation"
))]
#[unsafe(method(viewWillTransitionToSize:withTransitionCoordinator:))]
#[unsafe(method_family = none)]
fn viewWillTransitionToSize_withTransitionCoordinator(
&self,
size: CGSize,
coordinator: &ProtocolObject<dyn UIViewControllerTransitionCoordinator>,
);
#[cfg(all(
feature = "UITraitCollection",
feature = "UIViewControllerTransitionCoordinator"
))]
#[unsafe(method(willTransitionToTraitCollection:withTransitionCoordinator:))]
#[unsafe(method_family = none)]
fn willTransitionToTraitCollection_withTransitionCoordinator(
&self,
new_collection: &UITraitCollection,
coordinator: &ProtocolObject<dyn UIViewControllerTransitionCoordinator>,
);
}
);
extern "C" {
pub static UIViewControllerShowDetailTargetDidChangeNotification: &'static NSNotificationName;
}
extern_class!(
#[unsafe(super(UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIResponder")]
pub struct UIViewController;
);
#[cfg(feature = "UIResponder")]
extern_conformance!(
unsafe impl NSCoding for UIViewController {}
);
#[cfg(feature = "UIResponder")]
extern_conformance!(
unsafe impl NSObjectProtocol for UIViewController {}
);
#[cfg(all(feature = "UIAppearance", feature = "UIResponder"))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UIViewController {}
);
#[cfg(feature = "UIResponder")]
extern_conformance!(
unsafe impl UIContentContainer for UIViewController {}
);
#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UIViewController {}
);
#[cfg(feature = "UIResponder")]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
extern_conformance!(
unsafe impl UITraitEnvironment for UIViewController {}
);
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[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(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(feature = "UIView")]
#[unsafe(method(view))]
#[unsafe(method_family = none)]
pub fn view(&self) -> Option<Retained<UIView>>;
#[cfg(feature = "UIView")]
#[unsafe(method(setView:))]
#[unsafe(method_family = none)]
pub fn setView(&self, view: Option<&UIView>);
#[unsafe(method(loadView))]
#[unsafe(method_family = none)]
pub fn loadView(&self);
#[unsafe(method(loadViewIfNeeded))]
#[unsafe(method_family = none)]
pub fn loadViewIfNeeded(&self);
#[cfg(feature = "UIView")]
#[unsafe(method(viewIfLoaded))]
#[unsafe(method_family = none)]
pub fn viewIfLoaded(&self) -> Option<Retained<UIView>>;
#[deprecated]
#[unsafe(method(viewWillUnload))]
#[unsafe(method_family = none)]
pub fn viewWillUnload(&self);
#[deprecated]
#[unsafe(method(viewDidUnload))]
#[unsafe(method_family = none)]
pub fn viewDidUnload(&self);
#[unsafe(method(viewDidLoad))]
#[unsafe(method_family = none)]
pub fn viewDidLoad(&self);
#[unsafe(method(isViewLoaded))]
#[unsafe(method_family = none)]
pub fn isViewLoaded(&self) -> bool;
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(nibName))]
#[unsafe(method_family = none)]
pub fn nibName(&self) -> Option<Retained<NSString>>;
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(nibBundle))]
#[unsafe(method_family = none)]
pub fn nibBundle(&self) -> Option<Retained<NSBundle>>;
#[cfg(feature = "UIStoryboard")]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(storyboard))]
#[unsafe(method_family = none)]
pub fn storyboard(&self) -> Option<Retained<UIStoryboard>>;
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(performSegueWithIdentifier:sender:))]
#[unsafe(method_family = none)]
pub unsafe fn performSegueWithIdentifier_sender(
&self,
identifier: &NSString,
sender: Option<&AnyObject>,
);
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(shouldPerformSegueWithIdentifier:sender:))]
#[unsafe(method_family = none)]
pub unsafe fn shouldPerformSegueWithIdentifier_sender(
&self,
identifier: &NSString,
sender: Option<&AnyObject>,
) -> bool;
#[cfg(feature = "UIStoryboardSegue")]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(prepareForSegue:sender:))]
#[unsafe(method_family = none)]
pub unsafe fn prepareForSegue_sender(
&self,
segue: &UIStoryboardSegue,
sender: Option<&AnyObject>,
);
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(canPerformUnwindSegueAction:fromViewController:sender:))]
#[unsafe(method_family = none)]
pub unsafe fn canPerformUnwindSegueAction_fromViewController_sender(
&self,
action: Sel,
from_view_controller: &UIViewController,
sender: Option<&AnyObject>,
) -> bool;
#[deprecated]
#[unsafe(method(canPerformUnwindSegueAction:fromViewController:withSender:))]
#[unsafe(method_family = none)]
pub unsafe fn canPerformUnwindSegueAction_fromViewController_withSender(
&self,
action: Sel,
from_view_controller: &UIViewController,
sender: &AnyObject,
) -> bool;
#[cfg(feature = "UIStoryboardSegue")]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(allowedChildViewControllersForUnwindingFromSource:))]
#[unsafe(method_family = none)]
pub fn allowedChildViewControllersForUnwindingFromSource(
&self,
source: &UIStoryboardUnwindSegueSource,
) -> Retained<NSArray<UIViewController>>;
#[cfg(feature = "UIStoryboardSegue")]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(childViewControllerContainingSegueSource:))]
#[unsafe(method_family = none)]
pub fn childViewControllerContainingSegueSource(
&self,
source: &UIStoryboardUnwindSegueSource,
) -> Option<Retained<UIViewController>>;
#[deprecated]
#[unsafe(method(viewControllerForUnwindSegueAction:fromViewController:withSender:))]
#[unsafe(method_family = none)]
pub unsafe fn viewControllerForUnwindSegueAction_fromViewController_withSender(
&self,
action: Sel,
from_view_controller: &UIViewController,
sender: Option<&AnyObject>,
) -> Option<Retained<UIViewController>>;
#[cfg(feature = "UIStoryboardSegue")]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(unwindForSegue:towardsViewController:))]
#[unsafe(method_family = none)]
pub fn unwindForSegue_towardsViewController(
&self,
unwind_segue: &UIStoryboardSegue,
subsequent_vc: &UIViewController,
);
#[cfg(feature = "UIStoryboardSegue")]
#[deprecated]
#[unsafe(method(segueForUnwindingToViewController:fromViewController:identifier:))]
#[unsafe(method_family = none)]
pub fn segueForUnwindingToViewController_fromViewController_identifier(
&self,
to_view_controller: &UIViewController,
from_view_controller: &UIViewController,
identifier: Option<&NSString>,
) -> Option<Retained<UIStoryboardSegue>>;
#[unsafe(method(viewWillAppear:))]
#[unsafe(method_family = none)]
pub fn viewWillAppear(&self, animated: bool);
#[unsafe(method(viewIsAppearing:))]
#[unsafe(method_family = none)]
pub fn viewIsAppearing(&self, animated: bool);
#[unsafe(method(viewDidAppear:))]
#[unsafe(method_family = none)]
pub fn viewDidAppear(&self, animated: bool);
#[unsafe(method(viewWillDisappear:))]
#[unsafe(method_family = none)]
pub fn viewWillDisappear(&self, animated: bool);
#[unsafe(method(viewDidDisappear:))]
#[unsafe(method_family = none)]
pub fn viewDidDisappear(&self, animated: bool);
#[unsafe(method(setNeedsUpdateProperties))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateProperties(&self);
#[unsafe(method(updateProperties))]
#[unsafe(method_family = none)]
pub fn updateProperties(&self);
#[unsafe(method(updatePropertiesIfNeeded))]
#[unsafe(method_family = none)]
pub fn updatePropertiesIfNeeded(&self);
#[unsafe(method(viewWillLayoutSubviews))]
#[unsafe(method_family = none)]
pub fn viewWillLayoutSubviews(&self);
#[unsafe(method(viewDidLayoutSubviews))]
#[unsafe(method_family = none)]
pub fn viewDidLayoutSubviews(&self);
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub fn title(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub fn setTitle(&self, title: Option<&NSString>);
#[unsafe(method(didReceiveMemoryWarning))]
#[unsafe(method_family = none)]
pub fn didReceiveMemoryWarning(&self);
#[unsafe(method(parentViewController))]
#[unsafe(method_family = none)]
pub fn parentViewController(&self) -> Option<Retained<UIViewController>>;
#[deprecated]
#[unsafe(method(modalViewController))]
#[unsafe(method_family = none)]
pub fn modalViewController(&self) -> Option<Retained<UIViewController>>;
#[unsafe(method(presentedViewController))]
#[unsafe(method_family = none)]
pub fn presentedViewController(&self) -> Option<Retained<UIViewController>>;
#[unsafe(method(presentingViewController))]
#[unsafe(method_family = none)]
pub fn presentingViewController(&self) -> Option<Retained<UIViewController>>;
#[unsafe(method(definesPresentationContext))]
#[unsafe(method_family = none)]
pub fn definesPresentationContext(&self) -> bool;
#[unsafe(method(setDefinesPresentationContext:))]
#[unsafe(method_family = none)]
pub fn setDefinesPresentationContext(&self, defines_presentation_context: bool);
#[unsafe(method(providesPresentationContextTransitionStyle))]
#[unsafe(method_family = none)]
pub fn providesPresentationContextTransitionStyle(&self) -> bool;
#[unsafe(method(setProvidesPresentationContextTransitionStyle:))]
#[unsafe(method_family = none)]
pub fn setProvidesPresentationContextTransitionStyle(
&self,
provides_presentation_context_transition_style: bool,
);
#[unsafe(method(restoresFocusAfterTransition))]
#[unsafe(method_family = none)]
pub fn restoresFocusAfterTransition(&self) -> bool;
#[unsafe(method(setRestoresFocusAfterTransition:))]
#[unsafe(method_family = none)]
pub fn setRestoresFocusAfterTransition(&self, restores_focus_after_transition: bool);
#[unsafe(method(focusGroupIdentifier))]
#[unsafe(method_family = none)]
pub fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setFocusGroupIdentifier:))]
#[unsafe(method_family = none)]
pub fn setFocusGroupIdentifier(&self, focus_group_identifier: Option<&NSString>);
#[unsafe(method(interactionActivityTrackingBaseName))]
#[unsafe(method_family = none)]
pub fn interactionActivityTrackingBaseName(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setInteractionActivityTrackingBaseName:))]
#[unsafe(method_family = none)]
pub fn setInteractionActivityTrackingBaseName(
&self,
interaction_activity_tracking_base_name: Option<&NSString>,
);
#[unsafe(method(isBeingPresented))]
#[unsafe(method_family = none)]
pub fn isBeingPresented(&self) -> bool;
#[unsafe(method(isBeingDismissed))]
#[unsafe(method_family = none)]
pub fn isBeingDismissed(&self) -> bool;
#[unsafe(method(isMovingToParentViewController))]
#[unsafe(method_family = none)]
pub fn isMovingToParentViewController(&self) -> bool;
#[unsafe(method(isMovingFromParentViewController))]
#[unsafe(method_family = none)]
pub fn isMovingFromParentViewController(&self) -> bool;
#[cfg(feature = "block2")]
#[unsafe(method(presentViewController:animated:completion:))]
#[unsafe(method_family = none)]
pub fn presentViewController_animated_completion(
&self,
view_controller_to_present: &UIViewController,
flag: bool,
completion: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(dismissViewControllerAnimated:completion:))]
#[unsafe(method_family = none)]
pub fn dismissViewControllerAnimated_completion(
&self,
flag: bool,
completion: Option<&block2::DynBlock<dyn Fn()>>,
);
#[deprecated]
#[unsafe(method(presentModalViewController:animated:))]
#[unsafe(method_family = none)]
pub fn presentModalViewController_animated(
&self,
modal_view_controller: &UIViewController,
animated: bool,
);
#[deprecated]
#[unsafe(method(dismissModalViewControllerAnimated:))]
#[unsafe(method_family = none)]
pub fn dismissModalViewControllerAnimated(&self, animated: bool);
#[unsafe(method(modalTransitionStyle))]
#[unsafe(method_family = none)]
pub fn modalTransitionStyle(&self) -> UIModalTransitionStyle;
#[unsafe(method(setModalTransitionStyle:))]
#[unsafe(method_family = none)]
pub fn setModalTransitionStyle(&self, modal_transition_style: UIModalTransitionStyle);
#[cfg(feature = "UIViewControllerTransition")]
#[unsafe(method(preferredTransition))]
#[unsafe(method_family = none)]
pub fn preferredTransition(&self) -> Option<Retained<UIViewControllerTransition>>;
#[cfg(feature = "UIViewControllerTransition")]
#[unsafe(method(setPreferredTransition:))]
#[unsafe(method_family = none)]
pub fn setPreferredTransition(
&self,
preferred_transition: Option<&UIViewControllerTransition>,
);
#[unsafe(method(modalPresentationStyle))]
#[unsafe(method_family = none)]
pub fn modalPresentationStyle(&self) -> UIModalPresentationStyle;
#[unsafe(method(setModalPresentationStyle:))]
#[unsafe(method_family = none)]
pub fn setModalPresentationStyle(&self, modal_presentation_style: UIModalPresentationStyle);
#[unsafe(method(modalPresentationCapturesStatusBarAppearance))]
#[unsafe(method_family = none)]
pub fn modalPresentationCapturesStatusBarAppearance(&self) -> bool;
#[unsafe(method(setModalPresentationCapturesStatusBarAppearance:))]
#[unsafe(method_family = none)]
pub fn setModalPresentationCapturesStatusBarAppearance(
&self,
modal_presentation_captures_status_bar_appearance: bool,
);
#[unsafe(method(disablesAutomaticKeyboardDismissal))]
#[unsafe(method_family = none)]
pub fn disablesAutomaticKeyboardDismissal(&self) -> bool;
#[deprecated]
#[unsafe(method(wantsFullScreenLayout))]
#[unsafe(method_family = none)]
pub fn wantsFullScreenLayout(&self) -> bool;
#[deprecated]
#[unsafe(method(setWantsFullScreenLayout:))]
#[unsafe(method_family = none)]
pub fn setWantsFullScreenLayout(&self, wants_full_screen_layout: bool);
#[cfg(feature = "UIGeometry")]
#[unsafe(method(edgesForExtendedLayout))]
#[unsafe(method_family = none)]
pub fn edgesForExtendedLayout(&self) -> UIRectEdge;
#[cfg(feature = "UIGeometry")]
#[unsafe(method(setEdgesForExtendedLayout:))]
#[unsafe(method_family = none)]
pub fn setEdgesForExtendedLayout(&self, edges_for_extended_layout: UIRectEdge);
#[unsafe(method(extendedLayoutIncludesOpaqueBars))]
#[unsafe(method_family = none)]
pub fn extendedLayoutIncludesOpaqueBars(&self) -> bool;
#[unsafe(method(setExtendedLayoutIncludesOpaqueBars:))]
#[unsafe(method_family = none)]
pub fn setExtendedLayoutIncludesOpaqueBars(
&self,
extended_layout_includes_opaque_bars: bool,
);
#[deprecated = "Use UIScrollView's contentInsetAdjustmentBehavior instead"]
#[unsafe(method(automaticallyAdjustsScrollViewInsets))]
#[unsafe(method_family = none)]
pub fn automaticallyAdjustsScrollViewInsets(&self) -> bool;
#[deprecated = "Use UIScrollView's contentInsetAdjustmentBehavior instead"]
#[unsafe(method(setAutomaticallyAdjustsScrollViewInsets:))]
#[unsafe(method_family = none)]
pub fn setAutomaticallyAdjustsScrollViewInsets(
&self,
automatically_adjusts_scroll_view_insets: bool,
);
#[cfg(all(feature = "UIGeometry", feature = "UIScrollView", feature = "UIView"))]
#[unsafe(method(setContentScrollView:forEdge:))]
#[unsafe(method_family = none)]
pub fn setContentScrollView_forEdge(
&self,
scroll_view: Option<&UIScrollView>,
edge: NSDirectionalRectEdge,
);
#[cfg(all(feature = "UIGeometry", feature = "UIScrollView", feature = "UIView"))]
#[unsafe(method(contentScrollViewForEdge:))]
#[unsafe(method_family = none)]
pub fn contentScrollViewForEdge(
&self,
edge: NSDirectionalRectEdge,
) -> Option<Retained<UIScrollView>>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(preferredContentSize))]
#[unsafe(method_family = none)]
pub fn preferredContentSize(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setPreferredContentSize:))]
#[unsafe(method_family = none)]
pub fn setPreferredContentSize(&self, preferred_content_size: CGSize);
#[cfg(feature = "UIApplication")]
#[deprecated = "Has no effect on visionOS"]
#[unsafe(method(preferredStatusBarStyle))]
#[unsafe(method_family = none)]
pub fn preferredStatusBarStyle(&self) -> UIStatusBarStyle;
#[deprecated = "Has no effect on visionOS"]
#[unsafe(method(prefersStatusBarHidden))]
#[unsafe(method_family = none)]
pub fn prefersStatusBarHidden(&self) -> bool;
#[cfg(feature = "UIApplication")]
#[deprecated = "Has no effect on visionOS"]
#[unsafe(method(preferredStatusBarUpdateAnimation))]
#[unsafe(method_family = none)]
pub fn preferredStatusBarUpdateAnimation(&self) -> UIStatusBarAnimation;
#[unsafe(method(setNeedsStatusBarAppearanceUpdate))]
#[unsafe(method_family = none)]
pub fn setNeedsStatusBarAppearanceUpdate(&self);
#[unsafe(method(targetViewControllerForAction:sender:))]
#[unsafe(method_family = none)]
pub unsafe fn targetViewControllerForAction_sender(
&self,
action: Sel,
sender: Option<&AnyObject>,
) -> Option<Retained<UIViewController>>;
#[unsafe(method(showViewController:sender:))]
#[unsafe(method_family = none)]
pub unsafe fn showViewController_sender(
&self,
vc: &UIViewController,
sender: Option<&AnyObject>,
);
#[unsafe(method(showDetailViewController:sender:))]
#[unsafe(method_family = none)]
pub unsafe fn showDetailViewController_sender(
&self,
vc: &UIViewController,
sender: Option<&AnyObject>,
);
#[cfg(feature = "UIInterface")]
#[unsafe(method(preferredUserInterfaceStyle))]
#[unsafe(method_family = none)]
pub fn preferredUserInterfaceStyle(&self) -> UIUserInterfaceStyle;
#[unsafe(method(setNeedsUserInterfaceAppearanceUpdate))]
#[unsafe(method_family = none)]
pub fn setNeedsUserInterfaceAppearanceUpdate(&self);
#[cfg(feature = "UIInterface")]
#[unsafe(method(overrideUserInterfaceStyle))]
#[unsafe(method_family = none)]
pub fn overrideUserInterfaceStyle(&self) -> UIUserInterfaceStyle;
#[cfg(feature = "UIInterface")]
#[unsafe(method(setOverrideUserInterfaceStyle:))]
#[unsafe(method_family = none)]
pub fn setOverrideUserInterfaceStyle(
&self,
override_user_interface_style: UIUserInterfaceStyle,
);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
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>;
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[deprecated = "Please use instance method `setNeedsUpdateOfSupportedInterfaceOrientations`."]
#[unsafe(method(attemptRotationToDeviceOrientation))]
#[unsafe(method_family = none)]
pub fn attemptRotationToDeviceOrientation(mtm: MainThreadMarker);
#[cfg(feature = "UIOrientation")]
#[deprecated]
#[unsafe(method(shouldAutorotateToInterfaceOrientation:))]
#[unsafe(method_family = none)]
pub fn shouldAutorotateToInterfaceOrientation(
&self,
to_interface_orientation: UIInterfaceOrientation,
) -> bool;
#[deprecated = "Update supported interface orientations and call setNeedsUpdateOfSupportedInterfaceOrientations to indicate a change."]
#[unsafe(method(shouldAutorotate))]
#[unsafe(method_family = none)]
pub fn shouldAutorotate(&self) -> bool;
#[cfg(feature = "UIOrientation")]
#[unsafe(method(supportedInterfaceOrientations))]
#[unsafe(method_family = none)]
pub fn supportedInterfaceOrientations(&self) -> UIInterfaceOrientationMask;
#[cfg(feature = "UIOrientation")]
#[unsafe(method(preferredInterfaceOrientationForPresentation))]
#[unsafe(method_family = none)]
pub fn preferredInterfaceOrientationForPresentation(&self) -> UIInterfaceOrientation;
#[unsafe(method(setNeedsUpdateOfSupportedInterfaceOrientations))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateOfSupportedInterfaceOrientations(&self);
#[cfg(feature = "UIView")]
#[deprecated = "Header views are animated along with the rest of the view hierarchy"]
#[unsafe(method(rotatingHeaderView))]
#[unsafe(method_family = none)]
pub fn rotatingHeaderView(&self) -> Option<Retained<UIView>>;
#[cfg(feature = "UIView")]
#[deprecated = "Footer views are animated along with the rest of the view hierarchy"]
#[unsafe(method(rotatingFooterView))]
#[unsafe(method_family = none)]
pub fn rotatingFooterView(&self) -> Option<Retained<UIView>>;
#[cfg(feature = "UIOrientation")]
#[deprecated]
#[unsafe(method(interfaceOrientation))]
#[unsafe(method_family = none)]
pub fn interfaceOrientation(&self) -> UIInterfaceOrientation;
#[cfg(feature = "UIOrientation")]
#[deprecated = "Implement viewWillTransitionToSize:withTransitionCoordinator: instead"]
#[unsafe(method(willRotateToInterfaceOrientation:duration:))]
#[unsafe(method_family = none)]
pub fn willRotateToInterfaceOrientation_duration(
&self,
to_interface_orientation: UIInterfaceOrientation,
duration: NSTimeInterval,
);
#[cfg(feature = "UIOrientation")]
#[deprecated]
#[unsafe(method(didRotateFromInterfaceOrientation:))]
#[unsafe(method_family = none)]
pub fn didRotateFromInterfaceOrientation(
&self,
from_interface_orientation: UIInterfaceOrientation,
);
#[cfg(feature = "UIOrientation")]
#[deprecated = "Implement viewWillTransitionToSize:withTransitionCoordinator: instead"]
#[unsafe(method(willAnimateRotationToInterfaceOrientation:duration:))]
#[unsafe(method_family = none)]
pub fn willAnimateRotationToInterfaceOrientation_duration(
&self,
to_interface_orientation: UIInterfaceOrientation,
duration: NSTimeInterval,
);
#[cfg(feature = "UIOrientation")]
#[deprecated]
#[unsafe(method(willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:))]
#[unsafe(method_family = none)]
pub fn willAnimateFirstHalfOfRotationToInterfaceOrientation_duration(
&self,
to_interface_orientation: UIInterfaceOrientation,
duration: NSTimeInterval,
);
#[cfg(feature = "UIOrientation")]
#[deprecated]
#[unsafe(method(didAnimateFirstHalfOfRotationToInterfaceOrientation:))]
#[unsafe(method_family = none)]
pub fn didAnimateFirstHalfOfRotationToInterfaceOrientation(
&self,
to_interface_orientation: UIInterfaceOrientation,
);
#[cfg(feature = "UIOrientation")]
#[deprecated]
#[unsafe(method(willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:))]
#[unsafe(method_family = none)]
pub fn willAnimateSecondHalfOfRotationFromInterfaceOrientation_duration(
&self,
from_interface_orientation: UIInterfaceOrientation,
duration: NSTimeInterval,
);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(isEditing))]
#[unsafe(method_family = none)]
pub fn isEditing(&self) -> bool;
#[unsafe(method(setEditing:))]
#[unsafe(method_family = none)]
pub fn setEditing(&self, editing: bool);
#[unsafe(method(setEditing:animated:))]
#[unsafe(method_family = none)]
pub fn setEditing_animated(&self, editing: bool, animated: bool);
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[unsafe(method(editButtonItem))]
#[unsafe(method_family = none)]
pub fn editButtonItem(&self) -> Retained<UIBarButtonItem>;
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(feature = "UISearchDisplayController")]
#[deprecated]
#[unsafe(method(searchDisplayController))]
#[unsafe(method_family = none)]
pub fn searchDisplayController(&self) -> Option<Retained<UISearchDisplayController>>;
);
}
extern "C" {
pub static UIViewControllerHierarchyInconsistencyException: &'static NSExceptionName;
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(childViewControllers))]
#[unsafe(method_family = none)]
pub fn childViewControllers(&self) -> Retained<NSArray<UIViewController>>;
#[unsafe(method(addChildViewController:))]
#[unsafe(method_family = none)]
pub fn addChildViewController(&self, child_controller: &UIViewController);
#[unsafe(method(removeFromParentViewController))]
#[unsafe(method_family = none)]
pub fn removeFromParentViewController(&self);
#[cfg(all(feature = "UIView", feature = "block2"))]
#[unsafe(method(transitionFromViewController:toViewController:duration:options:animations:completion:))]
#[unsafe(method_family = none)]
pub fn transitionFromViewController_toViewController_duration_options_animations_completion(
&self,
from_view_controller: &UIViewController,
to_view_controller: &UIViewController,
duration: NSTimeInterval,
options: UIViewAnimationOptions,
animations: Option<&block2::DynBlock<dyn Fn()>>,
completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
);
#[unsafe(method(beginAppearanceTransition:animated:))]
#[unsafe(method_family = none)]
pub fn beginAppearanceTransition_animated(&self, is_appearing: bool, animated: bool);
#[unsafe(method(endAppearanceTransition))]
#[unsafe(method_family = none)]
pub fn endAppearanceTransition(&self);
#[deprecated = "Has no effect on visionOS"]
#[unsafe(method(childViewControllerForStatusBarStyle))]
#[unsafe(method_family = none)]
pub fn childViewControllerForStatusBarStyle(&self) -> Option<Retained<UIViewController>>;
#[deprecated = "Has no effect on visionOS"]
#[unsafe(method(childViewControllerForStatusBarHidden))]
#[unsafe(method_family = none)]
pub fn childViewControllerForStatusBarHidden(&self) -> Option<Retained<UIViewController>>;
#[cfg(feature = "UITraitCollection")]
#[deprecated = "Use the traitOverrides property on the child view controller instead"]
#[unsafe(method(setOverrideTraitCollection:forChildViewController:))]
#[unsafe(method_family = none)]
pub fn setOverrideTraitCollection_forChildViewController(
&self,
collection: Option<&UITraitCollection>,
child_view_controller: &UIViewController,
);
#[cfg(feature = "UITraitCollection")]
#[deprecated = "Use the traitOverrides property on the child view controller instead"]
#[unsafe(method(overrideTraitCollectionForChildViewController:))]
#[unsafe(method_family = none)]
pub fn overrideTraitCollectionForChildViewController(
&self,
child_view_controller: &UIViewController,
) -> Option<Retained<UITraitCollection>>;
#[unsafe(method(childViewControllerForUserInterfaceStyle))]
#[unsafe(method_family = none)]
pub fn childViewControllerForUserInterfaceStyle(
&self,
) -> Option<Retained<UIViewController>>;
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[deprecated]
#[unsafe(method(automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers))]
#[unsafe(method_family = none)]
pub fn automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers(
&self,
) -> bool;
#[deprecated = "Manually forward viewWillTransitionToSize:withTransitionCoordinator: if necessary"]
#[unsafe(method(shouldAutomaticallyForwardRotationMethods))]
#[unsafe(method_family = none)]
pub fn shouldAutomaticallyForwardRotationMethods(&self) -> bool;
#[unsafe(method(shouldAutomaticallyForwardAppearanceMethods))]
#[unsafe(method_family = none)]
pub fn shouldAutomaticallyForwardAppearanceMethods(&self) -> bool;
#[unsafe(method(willMoveToParentViewController:))]
#[unsafe(method_family = none)]
pub fn willMoveToParentViewController(&self, parent: Option<&UIViewController>);
#[unsafe(method(didMoveToParentViewController:))]
#[unsafe(method_family = none)]
pub fn didMoveToParentViewController(&self, parent: Option<&UIViewController>);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(restorationIdentifier))]
#[unsafe(method_family = none)]
pub fn restorationIdentifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setRestorationIdentifier:))]
#[unsafe(method_family = none)]
pub fn setRestorationIdentifier(&self, restoration_identifier: Option<&NSString>);
#[cfg(feature = "UIStateRestoration")]
#[unsafe(method(restorationClass))]
#[unsafe(method_family = none)]
pub unsafe fn restorationClass(&self) -> Option<&'static AnyClass>;
#[cfg(feature = "UIStateRestoration")]
#[unsafe(method(setRestorationClass:))]
#[unsafe(method_family = none)]
pub unsafe fn setRestorationClass(&self, restoration_class: Option<&AnyClass>);
#[unsafe(method(encodeRestorableStateWithCoder:))]
#[unsafe(method_family = none)]
pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
#[unsafe(method(decodeRestorableStateWithCoder:))]
#[unsafe(method_family = none)]
pub unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);
#[unsafe(method(applicationFinishedRestoringState))]
#[unsafe(method_family = none)]
pub fn applicationFinishedRestoringState(&self);
);
}
#[cfg(all(feature = "UIResponder", feature = "UIStateRestoration"))]
extern_conformance!(
unsafe impl UIStateRestoring for UIViewController {}
);
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(updateViewConstraints))]
#[unsafe(method_family = none)]
pub fn updateViewConstraints(&self);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(feature = "UIViewControllerTransitioning")]
#[unsafe(method(transitioningDelegate))]
#[unsafe(method_family = none)]
pub fn transitioningDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UIViewControllerTransitioningDelegate>>>;
#[cfg(feature = "UIViewControllerTransitioning")]
#[unsafe(method(setTransitioningDelegate:))]
#[unsafe(method_family = none)]
pub fn setTransitioningDelegate(
&self,
transitioning_delegate: Option<
&ProtocolObject<dyn UIViewControllerTransitioningDelegate>,
>,
);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(feature = "NSLayoutConstraint")]
#[deprecated = "Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor"]
#[unsafe(method(topLayoutGuide))]
#[unsafe(method_family = none)]
pub fn topLayoutGuide(&self) -> Retained<ProtocolObject<dyn UILayoutSupport>>;
#[cfg(feature = "NSLayoutConstraint")]
#[deprecated = "Use view.safeAreaLayoutGuide.bottomAnchor instead of bottomLayoutGuide.topAnchor"]
#[unsafe(method(bottomLayoutGuide))]
#[unsafe(method_family = none)]
pub fn bottomLayoutGuide(&self) -> Retained<ProtocolObject<dyn UILayoutSupport>>;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(additionalSafeAreaInsets))]
#[unsafe(method_family = none)]
pub fn additionalSafeAreaInsets(&self) -> UIEdgeInsets;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(setAdditionalSafeAreaInsets:))]
#[unsafe(method_family = none)]
pub fn setAdditionalSafeAreaInsets(&self, additional_safe_area_insets: UIEdgeInsets);
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(systemMinimumLayoutMargins))]
#[unsafe(method_family = none)]
pub fn systemMinimumLayoutMargins(&self) -> NSDirectionalEdgeInsets;
#[unsafe(method(viewRespectsSystemMinimumLayoutMargins))]
#[unsafe(method_family = none)]
pub fn viewRespectsSystemMinimumLayoutMargins(&self) -> bool;
#[unsafe(method(setViewRespectsSystemMinimumLayoutMargins:))]
#[unsafe(method_family = none)]
pub fn setViewRespectsSystemMinimumLayoutMargins(
&self,
view_respects_system_minimum_layout_margins: bool,
);
#[unsafe(method(viewLayoutMarginsDidChange))]
#[unsafe(method_family = none)]
pub fn viewLayoutMarginsDidChange(&self);
#[unsafe(method(viewSafeAreaInsetsDidChange))]
#[unsafe(method_family = none)]
pub fn viewSafeAreaInsetsDidChange(&self);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(all(
feature = "UICommand",
feature = "UIKeyCommand",
feature = "UIMenuElement"
))]
#[unsafe(method(addKeyCommand:))]
#[unsafe(method_family = none)]
pub fn addKeyCommand(&self, key_command: &UIKeyCommand);
#[cfg(all(
feature = "UICommand",
feature = "UIKeyCommand",
feature = "UIMenuElement"
))]
#[unsafe(method(removeKeyCommand:))]
#[unsafe(method_family = none)]
pub fn removeKeyCommand(&self, key_command: &UIKeyCommand);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(performsActionsWhilePresentingModally))]
#[unsafe(method_family = none)]
pub fn performsActionsWhilePresentingModally(&self) -> bool;
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(extensionContext))]
#[unsafe(method_family = none)]
pub fn extensionContext(&self) -> Option<Retained<NSExtensionContext>>;
);
}
#[cfg(feature = "UIResponder")]
extern_conformance!(
unsafe impl NSExtensionRequestHandling for UIViewController {}
);
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(feature = "UIPresentationController")]
#[unsafe(method(presentationController))]
#[unsafe(method_family = none)]
pub fn presentationController(&self) -> Option<Retained<UIPresentationController>>;
#[cfg(all(
feature = "UIPresentationController",
feature = "UISheetPresentationController"
))]
#[unsafe(method(sheetPresentationController))]
#[unsafe(method_family = none)]
pub fn sheetPresentationController(
&self,
) -> Option<Retained<UISheetPresentationController>>;
#[cfg(all(
feature = "UIPopoverPresentationController",
feature = "UIPresentationController"
))]
#[unsafe(method(popoverPresentationController))]
#[unsafe(method_family = none)]
pub fn popoverPresentationController(
&self,
) -> Option<Retained<UIPopoverPresentationController>>;
#[cfg(feature = "UIPresentationController")]
#[unsafe(method(activePresentationController))]
#[unsafe(method_family = none)]
pub fn activePresentationController(&self) -> Option<Retained<UIPresentationController>>;
#[unsafe(method(isModalInPresentation))]
#[unsafe(method_family = none)]
pub fn isModalInPresentation(&self) -> bool;
#[unsafe(method(setModalInPresentation:))]
#[unsafe(method_family = none)]
pub fn setModalInPresentation(&self, modal_in_presentation: bool);
);
}
extern_protocol!(
pub unsafe trait UIViewControllerPreviewing: NSObjectProtocol + MainThreadOnly {
#[cfg(feature = "UIGestureRecognizer")]
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(previewingGestureRecognizerForFailureRelationship))]
#[unsafe(method_family = none)]
fn previewingGestureRecognizerForFailureRelationship(
&self,
) -> Retained<UIGestureRecognizer>;
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
fn delegate(&self) -> Retained<ProtocolObject<dyn UIViewControllerPreviewingDelegate>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(sourceView))]
#[unsafe(method_family = none)]
fn sourceView(&self) -> Retained<UIView>;
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(sourceRect))]
#[unsafe(method_family = none)]
fn sourceRect(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(setSourceRect:))]
#[unsafe(method_family = none)]
fn setSourceRect(&self, source_rect: CGRect);
}
);
extern_protocol!(
pub unsafe trait UIViewControllerPreviewingDelegate:
NSObjectProtocol + MainThreadOnly
{
#[cfg(all(feature = "UIResponder", feature = "objc2-core-foundation"))]
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(previewingContext:viewControllerForLocation:))]
#[unsafe(method_family = none)]
fn previewingContext_viewControllerForLocation(
&self,
previewing_context: &ProtocolObject<dyn UIViewControllerPreviewing>,
location: CGPoint,
) -> Option<Retained<UIViewController>>;
#[cfg(feature = "UIResponder")]
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(previewingContext:commitViewController:))]
#[unsafe(method_family = none)]
fn previewingContext_commitViewController(
&self,
previewing_context: &ProtocolObject<dyn UIViewControllerPreviewing>,
view_controller_to_commit: &UIViewController,
);
}
);
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(feature = "UIView")]
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(registerForPreviewingWithDelegate:sourceView:))]
#[unsafe(method_family = none)]
pub fn registerForPreviewingWithDelegate_sourceView(
&self,
delegate: &ProtocolObject<dyn UIViewControllerPreviewingDelegate>,
source_view: &UIView,
) -> Retained<ProtocolObject<dyn UIViewControllerPreviewing>>;
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(unregisterForPreviewingWithContext:))]
#[unsafe(method_family = none)]
pub fn unregisterForPreviewingWithContext(
&self,
previewing: &ProtocolObject<dyn UIViewControllerPreviewing>,
);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(childViewControllerForScreenEdgesDeferringSystemGestures))]
#[unsafe(method_family = none)]
pub fn childViewControllerForScreenEdgesDeferringSystemGestures(
&self,
) -> Option<Retained<UIViewController>>;
#[cfg(feature = "UIGeometry")]
#[unsafe(method(preferredScreenEdgesDeferringSystemGestures))]
#[unsafe(method_family = none)]
pub fn preferredScreenEdgesDeferringSystemGestures(&self) -> UIRectEdge;
#[unsafe(method(setNeedsUpdateOfScreenEdgesDeferringSystemGestures))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateOfScreenEdgesDeferringSystemGestures(&self);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(childViewControllerForHomeIndicatorAutoHidden))]
#[unsafe(method_family = none)]
pub fn childViewControllerForHomeIndicatorAutoHidden(
&self,
) -> Option<Retained<UIViewController>>;
#[unsafe(method(prefersHomeIndicatorAutoHidden))]
#[unsafe(method_family = none)]
pub fn prefersHomeIndicatorAutoHidden(&self) -> bool;
#[unsafe(method(setNeedsUpdateOfHomeIndicatorAutoHidden))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateOfHomeIndicatorAutoHidden(&self);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(childViewControllerForPointerLock))]
#[unsafe(method_family = none)]
pub fn childViewControllerForPointerLock(&self) -> Option<Retained<UIViewController>>;
#[unsafe(method(prefersPointerLocked))]
#[unsafe(method_family = none)]
pub fn prefersPointerLocked(&self) -> bool;
#[unsafe(method(setNeedsUpdateOfPrefersPointerLocked))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateOfPrefersPointerLocked(&self);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(feature = "UIContentConfiguration")]
#[unsafe(method(contentUnavailableConfiguration))]
#[unsafe(method_family = none)]
pub fn contentUnavailableConfiguration(
&self,
) -> Option<Retained<ProtocolObject<dyn UIContentConfiguration>>>;
#[cfg(feature = "UIContentConfiguration")]
#[unsafe(method(setContentUnavailableConfiguration:))]
#[unsafe(method_family = none)]
pub fn setContentUnavailableConfiguration(
&self,
content_unavailable_configuration: Option<&ProtocolObject<dyn UIContentConfiguration>>,
);
#[cfg(feature = "UIContentUnavailableConfigurationState")]
#[unsafe(method(contentUnavailableConfigurationState))]
#[unsafe(method_family = none)]
pub fn contentUnavailableConfigurationState(
&self,
) -> Retained<UIContentUnavailableConfigurationState>;
#[unsafe(method(setNeedsUpdateContentUnavailableConfiguration))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateContentUnavailableConfiguration(&self);
#[cfg(feature = "UIContentUnavailableConfigurationState")]
#[unsafe(method(updateContentUnavailableConfigurationUsingState:))]
#[unsafe(method_family = none)]
pub fn updateContentUnavailableConfigurationUsingState(
&self,
state: &UIContentUnavailableConfigurationState,
);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(childViewControllerForInterfaceOrientationLock))]
#[unsafe(method_family = none)]
pub fn childViewControllerForInterfaceOrientationLock(
&self,
) -> Option<Retained<UIViewController>>;
#[unsafe(method(prefersInterfaceOrientationLocked))]
#[unsafe(method_family = none)]
pub fn prefersInterfaceOrientationLocked(&self) -> bool;
#[unsafe(method(setNeedsUpdateOfPrefersInterfaceOrientationLocked))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateOfPrefersInterfaceOrientationLocked(&self);
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
#[unsafe(method(previewActionItems))]
#[unsafe(method_family = none)]
pub fn previewActionItems(
&self,
) -> Retained<NSArray<ProtocolObject<dyn UIPreviewActionItem>>>;
);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[cfg(feature = "UITraitCollection")]
#[unsafe(method(traitOverrides))]
#[unsafe(method_family = none)]
pub fn traitOverrides(&self) -> Retained<ProtocolObject<dyn UITraitOverrides>>;
#[unsafe(method(updateTraitsIfNeeded))]
#[unsafe(method_family = none)]
pub fn updateTraitsIfNeeded(&self);
);
}
#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
extern_conformance!(
unsafe impl UITraitChangeObservable for UIViewController {}
);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIContainerBackgroundStyle(pub NSInteger);
impl UIContainerBackgroundStyle {
#[doc(alias = "UIContainerBackgroundStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIContainerBackgroundStyleGlass")]
pub const Glass: Self = Self(1);
#[doc(alias = "UIContainerBackgroundStyleHidden")]
pub const Hidden: Self = Self(2);
}
unsafe impl Encode for UIContainerBackgroundStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIContainerBackgroundStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "UIResponder")]
impl UIViewController {
extern_methods!(
#[unsafe(method(preferredContainerBackgroundStyle))]
#[unsafe(method_family = none)]
pub fn preferredContainerBackgroundStyle(&self) -> UIContainerBackgroundStyle;
#[unsafe(method(childViewControllerForPreferredContainerBackgroundStyle))]
#[unsafe(method_family = none)]
pub fn childViewControllerForPreferredContainerBackgroundStyle(
&self,
) -> Option<Retained<UIViewController>>;
#[unsafe(method(setNeedsUpdateOfPreferredContainerBackgroundStyle))]
#[unsafe(method_family = none)]
pub fn setNeedsUpdateOfPreferredContainerBackgroundStyle(&self);
);
}
extern_protocol!(
pub unsafe trait UIPreviewActionItem: NSObjectProtocol + MainThreadOnly {
#[unsafe(method(title))]
#[unsafe(method_family = none)]
fn title(&self) -> Retained<NSString>;
}
);
#[deprecated = "Please use UIContextMenuInteraction."]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPreviewActionStyle(pub NSInteger);
impl UIPreviewActionStyle {
#[doc(alias = "UIPreviewActionStyleDefault")]
#[deprecated = "Please use UIContextMenuInteraction."]
pub const Default: Self = Self(0);
#[doc(alias = "UIPreviewActionStyleSelected")]
#[deprecated = "Please use UIContextMenuInteraction."]
pub const Selected: Self = Self(1);
#[doc(alias = "UIPreviewActionStyleDestructive")]
#[deprecated = "Please use UIContextMenuInteraction."]
pub const Destructive: Self = Self(2);
}
unsafe impl Encode for UIPreviewActionStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPreviewActionStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use UIContextMenuInteraction."]
pub struct UIPreviewAction;
);
extern_conformance!(
unsafe impl NSCopying for UIPreviewAction {}
);
unsafe impl CopyingHelper for UIPreviewAction {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIPreviewAction {}
);
extern_conformance!(
unsafe impl UIPreviewActionItem for UIPreviewAction {}
);
impl UIPreviewAction {
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "block2"))]
#[unsafe(method(handler))]
#[unsafe(method_family = none)]
pub unsafe fn handler(
&self,
) -> NonNull<
block2::DynBlock<
dyn Fn(NonNull<ProtocolObject<dyn UIPreviewActionItem>>, NonNull<UIViewController>),
>,
>;
#[cfg(all(feature = "UIResponder", feature = "block2"))]
#[unsafe(method(actionWithTitle:style:handler:))]
#[unsafe(method_family = none)]
pub fn actionWithTitle_style_handler(
title: &NSString,
style: UIPreviewActionStyle,
handler: &block2::DynBlock<dyn Fn(NonNull<UIPreviewAction>, NonNull<UIViewController>)>,
mtm: MainThreadMarker,
) -> Retained<Self>;
);
}
impl UIPreviewAction {
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_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use UIContextMenuInteraction."]
pub struct UIPreviewActionGroup;
);
extern_conformance!(
unsafe impl NSCopying for UIPreviewActionGroup {}
);
unsafe impl CopyingHelper for UIPreviewActionGroup {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIPreviewActionGroup {}
);
extern_conformance!(
unsafe impl UIPreviewActionItem for UIPreviewActionGroup {}
);
impl UIPreviewActionGroup {
extern_methods!(
#[unsafe(method(actionGroupWithTitle:style:actions:))]
#[unsafe(method_family = none)]
pub fn actionGroupWithTitle_style_actions(
title: &NSString,
style: UIPreviewActionStyle,
actions: &NSArray<UIPreviewAction>,
mtm: MainThreadMarker,
) -> Retained<Self>;
);
}
impl UIPreviewActionGroup {
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>;
);
}