1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UIModalTransitionStyle(pub NSInteger);
17impl UIModalTransitionStyle {
18 #[doc(alias = "UIModalTransitionStyleCoverVertical")]
19 pub const CoverVertical: Self = Self(0);
20 #[doc(alias = "UIModalTransitionStyleFlipHorizontal")]
21 pub const FlipHorizontal: Self = Self(1);
22 #[doc(alias = "UIModalTransitionStyleCrossDissolve")]
23 pub const CrossDissolve: Self = Self(2);
24 #[doc(alias = "UIModalTransitionStylePartialCurl")]
25 pub const PartialCurl: Self = Self(3);
26}
27
28unsafe impl Encode for UIModalTransitionStyle {
29 const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for UIModalTransitionStyle {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36#[repr(transparent)]
39#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
40pub struct UIModalPresentationStyle(pub NSInteger);
41impl UIModalPresentationStyle {
42 #[doc(alias = "UIModalPresentationFullScreen")]
43 pub const FullScreen: Self = Self(0);
44 #[doc(alias = "UIModalPresentationPageSheet")]
45 pub const PageSheet: Self = Self(1);
46 #[doc(alias = "UIModalPresentationFormSheet")]
47 pub const FormSheet: Self = Self(2);
48 #[doc(alias = "UIModalPresentationCurrentContext")]
49 pub const CurrentContext: Self = Self(3);
50 #[doc(alias = "UIModalPresentationCustom")]
51 pub const Custom: Self = Self(4);
52 #[doc(alias = "UIModalPresentationOverFullScreen")]
53 pub const OverFullScreen: Self = Self(5);
54 #[doc(alias = "UIModalPresentationOverCurrentContext")]
55 pub const OverCurrentContext: Self = Self(6);
56 #[doc(alias = "UIModalPresentationPopover")]
57 pub const Popover: Self = Self(7);
58 #[doc(alias = "UIModalPresentationBlurOverFullScreen")]
59 pub const BlurOverFullScreen: Self = Self(8);
60 #[doc(alias = "UIModalPresentationNone")]
61 pub const None: Self = Self(-1);
62 #[doc(alias = "UIModalPresentationAutomatic")]
63 pub const Automatic: Self = Self(-2);
64}
65
66unsafe impl Encode for UIModalPresentationStyle {
67 const ENCODING: Encoding = NSInteger::ENCODING;
68}
69
70unsafe impl RefEncode for UIModalPresentationStyle {
71 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
72}
73
74extern_protocol!(
75 pub unsafe trait UIContentContainer: NSObjectProtocol + MainThreadOnly {
77 #[cfg(feature = "objc2-core-foundation")]
78 #[unsafe(method(preferredContentSize))]
79 #[unsafe(method_family = none)]
80 unsafe fn preferredContentSize(&self) -> CGSize;
81
82 #[unsafe(method(preferredContentSizeDidChangeForChildContentContainer:))]
83 #[unsafe(method_family = none)]
84 unsafe fn preferredContentSizeDidChangeForChildContentContainer(
85 &self,
86 container: &ProtocolObject<dyn UIContentContainer>,
87 );
88
89 #[unsafe(method(systemLayoutFittingSizeDidChangeForChildContentContainer:))]
90 #[unsafe(method_family = none)]
91 unsafe fn systemLayoutFittingSizeDidChangeForChildContentContainer(
92 &self,
93 container: &ProtocolObject<dyn UIContentContainer>,
94 );
95
96 #[cfg(feature = "objc2-core-foundation")]
97 #[unsafe(method(sizeForChildContentContainer:withParentContainerSize:))]
98 #[unsafe(method_family = none)]
99 unsafe fn sizeForChildContentContainer_withParentContainerSize(
100 &self,
101 container: &ProtocolObject<dyn UIContentContainer>,
102 parent_size: CGSize,
103 ) -> CGSize;
104
105 #[cfg(all(
106 feature = "UIViewControllerTransitionCoordinator",
107 feature = "objc2-core-foundation"
108 ))]
109 #[unsafe(method(viewWillTransitionToSize:withTransitionCoordinator:))]
110 #[unsafe(method_family = none)]
111 unsafe fn viewWillTransitionToSize_withTransitionCoordinator(
112 &self,
113 size: CGSize,
114 coordinator: &ProtocolObject<dyn UIViewControllerTransitionCoordinator>,
115 );
116
117 #[cfg(all(
118 feature = "UITraitCollection",
119 feature = "UIViewControllerTransitionCoordinator"
120 ))]
121 #[unsafe(method(willTransitionToTraitCollection:withTransitionCoordinator:))]
122 #[unsafe(method_family = none)]
123 unsafe fn willTransitionToTraitCollection_withTransitionCoordinator(
124 &self,
125 new_collection: &UITraitCollection,
126 coordinator: &ProtocolObject<dyn UIViewControllerTransitionCoordinator>,
127 );
128 }
129);
130
131extern "C" {
132 pub static UIViewControllerShowDetailTargetDidChangeNotification: &'static NSNotificationName;
134}
135
136extern_class!(
137 #[unsafe(super(UIResponder, NSObject))]
139 #[thread_kind = MainThreadOnly]
140 #[derive(Debug, PartialEq, Eq, Hash)]
141 #[cfg(feature = "UIResponder")]
142 pub struct UIViewController;
143);
144
145#[cfg(feature = "UIResponder")]
146extern_conformance!(
147 unsafe impl NSCoding for UIViewController {}
148);
149
150#[cfg(feature = "UIResponder")]
151extern_conformance!(
152 unsafe impl NSObjectProtocol for UIViewController {}
153);
154
155#[cfg(all(feature = "UIAppearance", feature = "UIResponder"))]
156extern_conformance!(
157 unsafe impl UIAppearanceContainer for UIViewController {}
158);
159
160#[cfg(feature = "UIResponder")]
161extern_conformance!(
162 unsafe impl UIContentContainer for UIViewController {}
163);
164
165#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
166extern_conformance!(
167 unsafe impl UIFocusEnvironment for UIViewController {}
168);
169
170#[cfg(feature = "UIResponder")]
171extern_conformance!(
172 unsafe impl UIResponderStandardEditActions for UIViewController {}
173);
174
175#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
176extern_conformance!(
177 unsafe impl UITraitEnvironment for UIViewController {}
178);
179
180#[cfg(feature = "UIResponder")]
181impl UIViewController {
182 extern_methods!(
183 #[unsafe(method(initWithNibName:bundle:))]
184 #[unsafe(method_family = init)]
185 pub unsafe fn initWithNibName_bundle(
186 this: Allocated<Self>,
187 nib_name_or_nil: Option<&NSString>,
188 nib_bundle_or_nil: Option<&NSBundle>,
189 ) -> Retained<Self>;
190
191 #[unsafe(method(initWithCoder:))]
192 #[unsafe(method_family = init)]
193 pub unsafe fn initWithCoder(
194 this: Allocated<Self>,
195 coder: &NSCoder,
196 ) -> Option<Retained<Self>>;
197
198 #[cfg(feature = "UIView")]
199 #[unsafe(method(view))]
200 #[unsafe(method_family = none)]
201 pub fn view(&self) -> Option<Retained<UIView>>;
202
203 #[cfg(feature = "UIView")]
204 #[unsafe(method(setView:))]
206 #[unsafe(method_family = none)]
207 pub fn setView(&self, view: Option<&UIView>);
208
209 #[unsafe(method(loadView))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn loadView(&self);
212
213 #[unsafe(method(loadViewIfNeeded))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn loadViewIfNeeded(&self);
216
217 #[cfg(feature = "UIView")]
218 #[unsafe(method(viewIfLoaded))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn viewIfLoaded(&self) -> Option<Retained<UIView>>;
221
222 #[deprecated]
223 #[unsafe(method(viewWillUnload))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn viewWillUnload(&self);
226
227 #[deprecated]
228 #[unsafe(method(viewDidUnload))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn viewDidUnload(&self);
231
232 #[unsafe(method(viewDidLoad))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn viewDidLoad(&self);
235
236 #[unsafe(method(isViewLoaded))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn isViewLoaded(&self) -> bool;
239
240 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
241 #[unsafe(method(nibName))]
242 #[unsafe(method_family = none)]
243 pub unsafe fn nibName(&self) -> Option<Retained<NSString>>;
244
245 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
246 #[unsafe(method(nibBundle))]
247 #[unsafe(method_family = none)]
248 pub unsafe fn nibBundle(&self) -> Option<Retained<NSBundle>>;
249
250 #[cfg(feature = "UIStoryboard")]
251 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
252 #[unsafe(method(storyboard))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn storyboard(&self) -> Option<Retained<UIStoryboard>>;
255
256 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
257 #[unsafe(method(performSegueWithIdentifier:sender:))]
258 #[unsafe(method_family = none)]
259 pub unsafe fn performSegueWithIdentifier_sender(
260 &self,
261 identifier: &NSString,
262 sender: Option<&AnyObject>,
263 );
264
265 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
266 #[unsafe(method(shouldPerformSegueWithIdentifier:sender:))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn shouldPerformSegueWithIdentifier_sender(
269 &self,
270 identifier: &NSString,
271 sender: Option<&AnyObject>,
272 ) -> bool;
273
274 #[cfg(feature = "UIStoryboardSegue")]
275 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
276 #[unsafe(method(prepareForSegue:sender:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn prepareForSegue_sender(
279 &self,
280 segue: &UIStoryboardSegue,
281 sender: Option<&AnyObject>,
282 );
283
284 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
285 #[unsafe(method(canPerformUnwindSegueAction:fromViewController:sender:))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn canPerformUnwindSegueAction_fromViewController_sender(
288 &self,
289 action: Sel,
290 from_view_controller: &UIViewController,
291 sender: Option<&AnyObject>,
292 ) -> bool;
293
294 #[deprecated]
295 #[unsafe(method(canPerformUnwindSegueAction:fromViewController:withSender:))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn canPerformUnwindSegueAction_fromViewController_withSender(
298 &self,
299 action: Sel,
300 from_view_controller: &UIViewController,
301 sender: &AnyObject,
302 ) -> bool;
303
304 #[cfg(feature = "UIStoryboardSegue")]
305 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
306 #[unsafe(method(allowedChildViewControllersForUnwindingFromSource:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn allowedChildViewControllersForUnwindingFromSource(
309 &self,
310 source: &UIStoryboardUnwindSegueSource,
311 ) -> Retained<NSArray<UIViewController>>;
312
313 #[cfg(feature = "UIStoryboardSegue")]
314 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
315 #[unsafe(method(childViewControllerContainingSegueSource:))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn childViewControllerContainingSegueSource(
318 &self,
319 source: &UIStoryboardUnwindSegueSource,
320 ) -> Option<Retained<UIViewController>>;
321
322 #[deprecated]
323 #[unsafe(method(viewControllerForUnwindSegueAction:fromViewController:withSender:))]
324 #[unsafe(method_family = none)]
325 pub unsafe fn viewControllerForUnwindSegueAction_fromViewController_withSender(
326 &self,
327 action: Sel,
328 from_view_controller: &UIViewController,
329 sender: Option<&AnyObject>,
330 ) -> Option<Retained<UIViewController>>;
331
332 #[cfg(feature = "UIStoryboardSegue")]
333 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
334 #[unsafe(method(unwindForSegue:towardsViewController:))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn unwindForSegue_towardsViewController(
337 &self,
338 unwind_segue: &UIStoryboardSegue,
339 subsequent_vc: &UIViewController,
340 );
341
342 #[cfg(feature = "UIStoryboardSegue")]
343 #[deprecated]
344 #[unsafe(method(segueForUnwindingToViewController:fromViewController:identifier:))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn segueForUnwindingToViewController_fromViewController_identifier(
347 &self,
348 to_view_controller: &UIViewController,
349 from_view_controller: &UIViewController,
350 identifier: Option<&NSString>,
351 ) -> Option<Retained<UIStoryboardSegue>>;
352
353 #[unsafe(method(viewWillAppear:))]
362 #[unsafe(method_family = none)]
363 pub unsafe fn viewWillAppear(&self, animated: bool);
364
365 #[unsafe(method(viewIsAppearing:))]
377 #[unsafe(method_family = none)]
378 pub unsafe fn viewIsAppearing(&self, animated: bool);
379
380 #[unsafe(method(viewDidAppear:))]
382 #[unsafe(method_family = none)]
383 pub unsafe fn viewDidAppear(&self, animated: bool);
384
385 #[unsafe(method(viewWillDisappear:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn viewWillDisappear(&self, animated: bool);
389
390 #[unsafe(method(viewDidDisappear:))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn viewDidDisappear(&self, animated: bool);
394
395 #[unsafe(method(viewWillLayoutSubviews))]
396 #[unsafe(method_family = none)]
397 pub unsafe fn viewWillLayoutSubviews(&self);
398
399 #[unsafe(method(viewDidLayoutSubviews))]
400 #[unsafe(method_family = none)]
401 pub unsafe fn viewDidLayoutSubviews(&self);
402
403 #[unsafe(method(title))]
404 #[unsafe(method_family = none)]
405 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
406
407 #[unsafe(method(setTitle:))]
409 #[unsafe(method_family = none)]
410 pub unsafe fn setTitle(&self, title: Option<&NSString>);
411
412 #[unsafe(method(didReceiveMemoryWarning))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn didReceiveMemoryWarning(&self);
415
416 #[unsafe(method(parentViewController))]
417 #[unsafe(method_family = none)]
418 pub unsafe fn parentViewController(&self) -> Option<Retained<UIViewController>>;
419
420 #[deprecated]
421 #[unsafe(method(modalViewController))]
422 #[unsafe(method_family = none)]
423 pub unsafe fn modalViewController(&self) -> Option<Retained<UIViewController>>;
424
425 #[unsafe(method(presentedViewController))]
426 #[unsafe(method_family = none)]
427 pub unsafe fn presentedViewController(&self) -> Option<Retained<UIViewController>>;
428
429 #[unsafe(method(presentingViewController))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn presentingViewController(&self) -> Option<Retained<UIViewController>>;
432
433 #[unsafe(method(definesPresentationContext))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn definesPresentationContext(&self) -> bool;
436
437 #[unsafe(method(setDefinesPresentationContext:))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn setDefinesPresentationContext(&self, defines_presentation_context: bool);
441
442 #[unsafe(method(providesPresentationContextTransitionStyle))]
443 #[unsafe(method_family = none)]
444 pub unsafe fn providesPresentationContextTransitionStyle(&self) -> bool;
445
446 #[unsafe(method(setProvidesPresentationContextTransitionStyle:))]
448 #[unsafe(method_family = none)]
449 pub unsafe fn setProvidesPresentationContextTransitionStyle(
450 &self,
451 provides_presentation_context_transition_style: bool,
452 );
453
454 #[unsafe(method(restoresFocusAfterTransition))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn restoresFocusAfterTransition(&self) -> bool;
457
458 #[unsafe(method(setRestoresFocusAfterTransition:))]
460 #[unsafe(method_family = none)]
461 pub unsafe fn setRestoresFocusAfterTransition(&self, restores_focus_after_transition: bool);
462
463 #[unsafe(method(focusGroupIdentifier))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>;
467
468 #[unsafe(method(setFocusGroupIdentifier:))]
470 #[unsafe(method_family = none)]
471 pub unsafe fn setFocusGroupIdentifier(&self, focus_group_identifier: Option<&NSString>);
472
473 #[unsafe(method(interactionActivityTrackingBaseName))]
475 #[unsafe(method_family = none)]
476 pub unsafe fn interactionActivityTrackingBaseName(&self) -> Option<Retained<NSString>>;
477
478 #[unsafe(method(setInteractionActivityTrackingBaseName:))]
480 #[unsafe(method_family = none)]
481 pub unsafe fn setInteractionActivityTrackingBaseName(
482 &self,
483 interaction_activity_tracking_base_name: Option<&NSString>,
484 );
485
486 #[unsafe(method(isBeingPresented))]
487 #[unsafe(method_family = none)]
488 pub unsafe fn isBeingPresented(&self) -> bool;
489
490 #[unsafe(method(isBeingDismissed))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn isBeingDismissed(&self) -> bool;
493
494 #[unsafe(method(isMovingToParentViewController))]
495 #[unsafe(method_family = none)]
496 pub unsafe fn isMovingToParentViewController(&self) -> bool;
497
498 #[unsafe(method(isMovingFromParentViewController))]
499 #[unsafe(method_family = none)]
500 pub unsafe fn isMovingFromParentViewController(&self) -> bool;
501
502 #[cfg(feature = "block2")]
503 #[unsafe(method(presentViewController:animated:completion:))]
504 #[unsafe(method_family = none)]
505 pub unsafe fn presentViewController_animated_completion(
506 &self,
507 view_controller_to_present: &UIViewController,
508 flag: bool,
509 completion: Option<&block2::DynBlock<dyn Fn()>>,
510 );
511
512 #[cfg(feature = "block2")]
513 #[unsafe(method(dismissViewControllerAnimated:completion:))]
514 #[unsafe(method_family = none)]
515 pub unsafe fn dismissViewControllerAnimated_completion(
516 &self,
517 flag: bool,
518 completion: Option<&block2::DynBlock<dyn Fn()>>,
519 );
520
521 #[deprecated]
522 #[unsafe(method(presentModalViewController:animated:))]
523 #[unsafe(method_family = none)]
524 pub unsafe fn presentModalViewController_animated(
525 &self,
526 modal_view_controller: &UIViewController,
527 animated: bool,
528 );
529
530 #[deprecated]
531 #[unsafe(method(dismissModalViewControllerAnimated:))]
532 #[unsafe(method_family = none)]
533 pub unsafe fn dismissModalViewControllerAnimated(&self, animated: bool);
534
535 #[unsafe(method(modalTransitionStyle))]
536 #[unsafe(method_family = none)]
537 pub unsafe fn modalTransitionStyle(&self) -> UIModalTransitionStyle;
538
539 #[unsafe(method(setModalTransitionStyle:))]
541 #[unsafe(method_family = none)]
542 pub unsafe fn setModalTransitionStyle(
543 &self,
544 modal_transition_style: UIModalTransitionStyle,
545 );
546
547 #[cfg(feature = "UIViewControllerTransition")]
548 #[unsafe(method(preferredTransition))]
554 #[unsafe(method_family = none)]
555 pub unsafe fn preferredTransition(&self) -> Option<Retained<UIViewControllerTransition>>;
556
557 #[cfg(feature = "UIViewControllerTransition")]
558 #[unsafe(method(setPreferredTransition:))]
560 #[unsafe(method_family = none)]
561 pub unsafe fn setPreferredTransition(
562 &self,
563 preferred_transition: Option<&UIViewControllerTransition>,
564 );
565
566 #[unsafe(method(modalPresentationStyle))]
567 #[unsafe(method_family = none)]
568 pub unsafe fn modalPresentationStyle(&self) -> UIModalPresentationStyle;
569
570 #[unsafe(method(setModalPresentationStyle:))]
572 #[unsafe(method_family = none)]
573 pub unsafe fn setModalPresentationStyle(
574 &self,
575 modal_presentation_style: UIModalPresentationStyle,
576 );
577
578 #[unsafe(method(modalPresentationCapturesStatusBarAppearance))]
579 #[unsafe(method_family = none)]
580 pub unsafe fn modalPresentationCapturesStatusBarAppearance(&self) -> bool;
581
582 #[unsafe(method(setModalPresentationCapturesStatusBarAppearance:))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn setModalPresentationCapturesStatusBarAppearance(
586 &self,
587 modal_presentation_captures_status_bar_appearance: bool,
588 );
589
590 #[unsafe(method(disablesAutomaticKeyboardDismissal))]
591 #[unsafe(method_family = none)]
592 pub unsafe fn disablesAutomaticKeyboardDismissal(&self) -> bool;
593
594 #[deprecated]
595 #[unsafe(method(wantsFullScreenLayout))]
596 #[unsafe(method_family = none)]
597 pub unsafe fn wantsFullScreenLayout(&self) -> bool;
598
599 #[deprecated]
601 #[unsafe(method(setWantsFullScreenLayout:))]
602 #[unsafe(method_family = none)]
603 pub unsafe fn setWantsFullScreenLayout(&self, wants_full_screen_layout: bool);
604
605 #[cfg(feature = "UIGeometry")]
606 #[unsafe(method(edgesForExtendedLayout))]
607 #[unsafe(method_family = none)]
608 pub unsafe fn edgesForExtendedLayout(&self) -> UIRectEdge;
609
610 #[cfg(feature = "UIGeometry")]
611 #[unsafe(method(setEdgesForExtendedLayout:))]
613 #[unsafe(method_family = none)]
614 pub unsafe fn setEdgesForExtendedLayout(&self, edges_for_extended_layout: UIRectEdge);
615
616 #[unsafe(method(extendedLayoutIncludesOpaqueBars))]
617 #[unsafe(method_family = none)]
618 pub unsafe fn extendedLayoutIncludesOpaqueBars(&self) -> bool;
619
620 #[unsafe(method(setExtendedLayoutIncludesOpaqueBars:))]
622 #[unsafe(method_family = none)]
623 pub unsafe fn setExtendedLayoutIncludesOpaqueBars(
624 &self,
625 extended_layout_includes_opaque_bars: bool,
626 );
627
628 #[deprecated = "Use UIScrollView's contentInsetAdjustmentBehavior instead"]
629 #[unsafe(method(automaticallyAdjustsScrollViewInsets))]
630 #[unsafe(method_family = none)]
631 pub unsafe fn automaticallyAdjustsScrollViewInsets(&self) -> bool;
632
633 #[deprecated = "Use UIScrollView's contentInsetAdjustmentBehavior instead"]
635 #[unsafe(method(setAutomaticallyAdjustsScrollViewInsets:))]
636 #[unsafe(method_family = none)]
637 pub unsafe fn setAutomaticallyAdjustsScrollViewInsets(
638 &self,
639 automatically_adjusts_scroll_view_insets: bool,
640 );
641
642 #[cfg(all(feature = "UIGeometry", feature = "UIScrollView", feature = "UIView"))]
643 #[unsafe(method(setContentScrollView:forEdge:))]
645 #[unsafe(method_family = none)]
646 pub unsafe fn setContentScrollView_forEdge(
647 &self,
648 scroll_view: Option<&UIScrollView>,
649 edge: NSDirectionalRectEdge,
650 );
651
652 #[cfg(all(feature = "UIGeometry", feature = "UIScrollView", feature = "UIView"))]
653 #[unsafe(method(contentScrollViewForEdge:))]
655 #[unsafe(method_family = none)]
656 pub unsafe fn contentScrollViewForEdge(
657 &self,
658 edge: NSDirectionalRectEdge,
659 ) -> Option<Retained<UIScrollView>>;
660
661 #[cfg(feature = "objc2-core-foundation")]
662 #[unsafe(method(preferredContentSize))]
663 #[unsafe(method_family = none)]
664 pub unsafe fn preferredContentSize(&self) -> CGSize;
665
666 #[cfg(feature = "objc2-core-foundation")]
667 #[unsafe(method(setPreferredContentSize:))]
669 #[unsafe(method_family = none)]
670 pub unsafe fn setPreferredContentSize(&self, preferred_content_size: CGSize);
671
672 #[cfg(feature = "UIApplication")]
673 #[deprecated = "Has no effect on visionOS"]
674 #[unsafe(method(preferredStatusBarStyle))]
675 #[unsafe(method_family = none)]
676 pub unsafe fn preferredStatusBarStyle(&self) -> UIStatusBarStyle;
677
678 #[deprecated = "Has no effect on visionOS"]
679 #[unsafe(method(prefersStatusBarHidden))]
680 #[unsafe(method_family = none)]
681 pub unsafe fn prefersStatusBarHidden(&self) -> bool;
682
683 #[cfg(feature = "UIApplication")]
684 #[deprecated = "Has no effect on visionOS"]
685 #[unsafe(method(preferredStatusBarUpdateAnimation))]
686 #[unsafe(method_family = none)]
687 pub unsafe fn preferredStatusBarUpdateAnimation(&self) -> UIStatusBarAnimation;
688
689 #[unsafe(method(setNeedsStatusBarAppearanceUpdate))]
690 #[unsafe(method_family = none)]
691 pub fn setNeedsStatusBarAppearanceUpdate(&self);
692
693 #[unsafe(method(targetViewControllerForAction:sender:))]
694 #[unsafe(method_family = none)]
695 pub unsafe fn targetViewControllerForAction_sender(
696 &self,
697 action: Sel,
698 sender: Option<&AnyObject>,
699 ) -> Option<Retained<UIViewController>>;
700
701 #[unsafe(method(showViewController:sender:))]
702 #[unsafe(method_family = none)]
703 pub unsafe fn showViewController_sender(
704 &self,
705 vc: &UIViewController,
706 sender: Option<&AnyObject>,
707 );
708
709 #[unsafe(method(showDetailViewController:sender:))]
710 #[unsafe(method_family = none)]
711 pub unsafe fn showDetailViewController_sender(
712 &self,
713 vc: &UIViewController,
714 sender: Option<&AnyObject>,
715 );
716
717 #[cfg(feature = "UIInterface")]
718 #[unsafe(method(preferredUserInterfaceStyle))]
719 #[unsafe(method_family = none)]
720 pub unsafe fn preferredUserInterfaceStyle(&self) -> UIUserInterfaceStyle;
721
722 #[unsafe(method(setNeedsUserInterfaceAppearanceUpdate))]
723 #[unsafe(method_family = none)]
724 pub unsafe fn setNeedsUserInterfaceAppearanceUpdate(&self);
725
726 #[cfg(feature = "UIInterface")]
727 #[unsafe(method(overrideUserInterfaceStyle))]
728 #[unsafe(method_family = none)]
729 pub unsafe fn overrideUserInterfaceStyle(&self) -> UIUserInterfaceStyle;
730
731 #[cfg(feature = "UIInterface")]
732 #[unsafe(method(setOverrideUserInterfaceStyle:))]
734 #[unsafe(method_family = none)]
735 pub unsafe fn setOverrideUserInterfaceStyle(
736 &self,
737 override_user_interface_style: UIUserInterfaceStyle,
738 );
739 );
740}
741
742#[cfg(feature = "UIResponder")]
744impl UIViewController {
745 extern_methods!(
746 #[unsafe(method(init))]
747 #[unsafe(method_family = init)]
748 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
749
750 #[unsafe(method(new))]
751 #[unsafe(method_family = new)]
752 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
753 );
754}
755
756#[cfg(feature = "UIResponder")]
758impl UIViewController {
759 extern_methods!(
760 #[deprecated = "Please use instance method `setNeedsUpdateOfSupportedInterfaceOrientations`."]
761 #[unsafe(method(attemptRotationToDeviceOrientation))]
762 #[unsafe(method_family = none)]
763 pub fn attemptRotationToDeviceOrientation(mtm: MainThreadMarker);
764
765 #[cfg(feature = "UIOrientation")]
766 #[deprecated]
767 #[unsafe(method(shouldAutorotateToInterfaceOrientation:))]
768 #[unsafe(method_family = none)]
769 pub unsafe fn shouldAutorotateToInterfaceOrientation(
770 &self,
771 to_interface_orientation: UIInterfaceOrientation,
772 ) -> bool;
773
774 #[deprecated = "Update supported interface orientations and call setNeedsUpdateOfSupportedInterfaceOrientations to indicate a change."]
775 #[unsafe(method(shouldAutorotate))]
776 #[unsafe(method_family = none)]
777 pub unsafe fn shouldAutorotate(&self) -> bool;
778
779 #[cfg(feature = "UIOrientation")]
780 #[unsafe(method(supportedInterfaceOrientations))]
781 #[unsafe(method_family = none)]
782 pub unsafe fn supportedInterfaceOrientations(&self) -> UIInterfaceOrientationMask;
783
784 #[cfg(feature = "UIOrientation")]
785 #[unsafe(method(preferredInterfaceOrientationForPresentation))]
786 #[unsafe(method_family = none)]
787 pub unsafe fn preferredInterfaceOrientationForPresentation(&self)
788 -> UIInterfaceOrientation;
789
790 #[unsafe(method(setNeedsUpdateOfSupportedInterfaceOrientations))]
793 #[unsafe(method_family = none)]
794 pub unsafe fn setNeedsUpdateOfSupportedInterfaceOrientations(&self);
795
796 #[cfg(feature = "UIView")]
797 #[deprecated = "Header views are animated along with the rest of the view hierarchy"]
798 #[unsafe(method(rotatingHeaderView))]
799 #[unsafe(method_family = none)]
800 pub unsafe fn rotatingHeaderView(&self) -> Option<Retained<UIView>>;
801
802 #[cfg(feature = "UIView")]
803 #[deprecated = "Footer views are animated along with the rest of the view hierarchy"]
804 #[unsafe(method(rotatingFooterView))]
805 #[unsafe(method_family = none)]
806 pub unsafe fn rotatingFooterView(&self) -> Option<Retained<UIView>>;
807
808 #[cfg(feature = "UIOrientation")]
809 #[deprecated]
810 #[unsafe(method(interfaceOrientation))]
811 #[unsafe(method_family = none)]
812 pub unsafe fn interfaceOrientation(&self) -> UIInterfaceOrientation;
813
814 #[cfg(feature = "UIOrientation")]
815 #[deprecated = "Implement viewWillTransitionToSize:withTransitionCoordinator: instead"]
816 #[unsafe(method(willRotateToInterfaceOrientation:duration:))]
817 #[unsafe(method_family = none)]
818 pub unsafe fn willRotateToInterfaceOrientation_duration(
819 &self,
820 to_interface_orientation: UIInterfaceOrientation,
821 duration: NSTimeInterval,
822 );
823
824 #[cfg(feature = "UIOrientation")]
825 #[deprecated]
826 #[unsafe(method(didRotateFromInterfaceOrientation:))]
827 #[unsafe(method_family = none)]
828 pub unsafe fn didRotateFromInterfaceOrientation(
829 &self,
830 from_interface_orientation: UIInterfaceOrientation,
831 );
832
833 #[cfg(feature = "UIOrientation")]
834 #[deprecated = "Implement viewWillTransitionToSize:withTransitionCoordinator: instead"]
835 #[unsafe(method(willAnimateRotationToInterfaceOrientation:duration:))]
836 #[unsafe(method_family = none)]
837 pub unsafe fn willAnimateRotationToInterfaceOrientation_duration(
838 &self,
839 to_interface_orientation: UIInterfaceOrientation,
840 duration: NSTimeInterval,
841 );
842
843 #[cfg(feature = "UIOrientation")]
844 #[deprecated]
845 #[unsafe(method(willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:))]
846 #[unsafe(method_family = none)]
847 pub unsafe fn willAnimateFirstHalfOfRotationToInterfaceOrientation_duration(
848 &self,
849 to_interface_orientation: UIInterfaceOrientation,
850 duration: NSTimeInterval,
851 );
852
853 #[cfg(feature = "UIOrientation")]
854 #[deprecated]
855 #[unsafe(method(didAnimateFirstHalfOfRotationToInterfaceOrientation:))]
856 #[unsafe(method_family = none)]
857 pub unsafe fn didAnimateFirstHalfOfRotationToInterfaceOrientation(
858 &self,
859 to_interface_orientation: UIInterfaceOrientation,
860 );
861
862 #[cfg(feature = "UIOrientation")]
863 #[deprecated]
864 #[unsafe(method(willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:))]
865 #[unsafe(method_family = none)]
866 pub unsafe fn willAnimateSecondHalfOfRotationFromInterfaceOrientation_duration(
867 &self,
868 from_interface_orientation: UIInterfaceOrientation,
869 duration: NSTimeInterval,
870 );
871 );
872}
873
874#[cfg(feature = "UIResponder")]
876impl UIViewController {
877 extern_methods!(
878 #[unsafe(method(isEditing))]
879 #[unsafe(method_family = none)]
880 pub unsafe fn isEditing(&self) -> bool;
881
882 #[unsafe(method(setEditing:))]
884 #[unsafe(method_family = none)]
885 pub unsafe fn setEditing(&self, editing: bool);
886
887 #[unsafe(method(setEditing:animated:))]
888 #[unsafe(method_family = none)]
889 pub unsafe fn setEditing_animated(&self, editing: bool, animated: bool);
890
891 #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
892 #[unsafe(method(editButtonItem))]
893 #[unsafe(method_family = none)]
894 pub unsafe fn editButtonItem(&self) -> Retained<UIBarButtonItem>;
895 );
896}
897
898#[cfg(feature = "UIResponder")]
900impl UIViewController {
901 extern_methods!(
902 #[cfg(feature = "UISearchDisplayController")]
903 #[deprecated]
904 #[unsafe(method(searchDisplayController))]
905 #[unsafe(method_family = none)]
906 pub unsafe fn searchDisplayController(&self)
907 -> Option<Retained<UISearchDisplayController>>;
908 );
909}
910
911extern "C" {
912 pub static UIViewControllerHierarchyInconsistencyException: &'static NSExceptionName;
914}
915
916#[cfg(feature = "UIResponder")]
918impl UIViewController {
919 extern_methods!(
920 #[unsafe(method(childViewControllers))]
921 #[unsafe(method_family = none)]
922 pub unsafe fn childViewControllers(&self) -> Retained<NSArray<UIViewController>>;
923
924 #[unsafe(method(addChildViewController:))]
925 #[unsafe(method_family = none)]
926 pub unsafe fn addChildViewController(&self, child_controller: &UIViewController);
927
928 #[unsafe(method(removeFromParentViewController))]
929 #[unsafe(method_family = none)]
930 pub unsafe fn removeFromParentViewController(&self);
931
932 #[cfg(all(feature = "UIView", feature = "block2"))]
933 #[unsafe(method(transitionFromViewController:toViewController:duration:options:animations:completion:))]
934 #[unsafe(method_family = none)]
935 pub unsafe fn transitionFromViewController_toViewController_duration_options_animations_completion(
936 &self,
937 from_view_controller: &UIViewController,
938 to_view_controller: &UIViewController,
939 duration: NSTimeInterval,
940 options: UIViewAnimationOptions,
941 animations: Option<&block2::DynBlock<dyn Fn()>>,
942 completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
943 );
944
945 #[unsafe(method(beginAppearanceTransition:animated:))]
946 #[unsafe(method_family = none)]
947 pub unsafe fn beginAppearanceTransition_animated(&self, is_appearing: bool, animated: bool);
948
949 #[unsafe(method(endAppearanceTransition))]
950 #[unsafe(method_family = none)]
951 pub unsafe fn endAppearanceTransition(&self);
952
953 #[deprecated = "Has no effect on visionOS"]
954 #[unsafe(method(childViewControllerForStatusBarStyle))]
955 #[unsafe(method_family = none)]
956 pub unsafe fn childViewControllerForStatusBarStyle(
957 &self,
958 ) -> Option<Retained<UIViewController>>;
959
960 #[deprecated = "Has no effect on visionOS"]
961 #[unsafe(method(childViewControllerForStatusBarHidden))]
962 #[unsafe(method_family = none)]
963 pub unsafe fn childViewControllerForStatusBarHidden(
964 &self,
965 ) -> Option<Retained<UIViewController>>;
966
967 #[cfg(feature = "UITraitCollection")]
968 #[deprecated = "Use the traitOverrides property on the child view controller instead"]
969 #[unsafe(method(setOverrideTraitCollection:forChildViewController:))]
970 #[unsafe(method_family = none)]
971 pub unsafe fn setOverrideTraitCollection_forChildViewController(
972 &self,
973 collection: Option<&UITraitCollection>,
974 child_view_controller: &UIViewController,
975 );
976
977 #[cfg(feature = "UITraitCollection")]
978 #[deprecated = "Use the traitOverrides property on the child view controller instead"]
979 #[unsafe(method(overrideTraitCollectionForChildViewController:))]
980 #[unsafe(method_family = none)]
981 pub unsafe fn overrideTraitCollectionForChildViewController(
982 &self,
983 child_view_controller: &UIViewController,
984 ) -> Option<Retained<UITraitCollection>>;
985
986 #[unsafe(method(childViewControllerForUserInterfaceStyle))]
987 #[unsafe(method_family = none)]
988 pub unsafe fn childViewControllerForUserInterfaceStyle(
989 &self,
990 ) -> Option<Retained<UIViewController>>;
991 );
992}
993
994#[cfg(feature = "UIResponder")]
996impl UIViewController {
997 extern_methods!(
998 #[deprecated]
999 #[unsafe(method(automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers))]
1000 #[unsafe(method_family = none)]
1001 pub unsafe fn automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers(
1002 &self,
1003 ) -> bool;
1004
1005 #[deprecated = "Manually forward viewWillTransitionToSize:withTransitionCoordinator: if necessary"]
1006 #[unsafe(method(shouldAutomaticallyForwardRotationMethods))]
1007 #[unsafe(method_family = none)]
1008 pub unsafe fn shouldAutomaticallyForwardRotationMethods(&self) -> bool;
1009
1010 #[unsafe(method(shouldAutomaticallyForwardAppearanceMethods))]
1011 #[unsafe(method_family = none)]
1012 pub unsafe fn shouldAutomaticallyForwardAppearanceMethods(&self) -> bool;
1013
1014 #[unsafe(method(willMoveToParentViewController:))]
1015 #[unsafe(method_family = none)]
1016 pub unsafe fn willMoveToParentViewController(&self, parent: Option<&UIViewController>);
1017
1018 #[unsafe(method(didMoveToParentViewController:))]
1019 #[unsafe(method_family = none)]
1020 pub unsafe fn didMoveToParentViewController(&self, parent: Option<&UIViewController>);
1021 );
1022}
1023
1024#[cfg(feature = "UIResponder")]
1026impl UIViewController {
1027 extern_methods!(
1028 #[unsafe(method(restorationIdentifier))]
1029 #[unsafe(method_family = none)]
1030 pub unsafe fn restorationIdentifier(&self) -> Option<Retained<NSString>>;
1031
1032 #[unsafe(method(setRestorationIdentifier:))]
1034 #[unsafe(method_family = none)]
1035 pub unsafe fn setRestorationIdentifier(&self, restoration_identifier: Option<&NSString>);
1036
1037 #[cfg(feature = "UIStateRestoration")]
1038 #[unsafe(method(restorationClass))]
1039 #[unsafe(method_family = none)]
1040 pub unsafe fn restorationClass(&self) -> Option<&'static AnyClass>;
1041
1042 #[cfg(feature = "UIStateRestoration")]
1043 #[unsafe(method(setRestorationClass:))]
1045 #[unsafe(method_family = none)]
1046 pub unsafe fn setRestorationClass(&self, restoration_class: Option<&AnyClass>);
1047
1048 #[unsafe(method(encodeRestorableStateWithCoder:))]
1049 #[unsafe(method_family = none)]
1050 pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
1051
1052 #[unsafe(method(decodeRestorableStateWithCoder:))]
1053 #[unsafe(method_family = none)]
1054 pub unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);
1055
1056 #[unsafe(method(applicationFinishedRestoringState))]
1057 #[unsafe(method_family = none)]
1058 pub unsafe fn applicationFinishedRestoringState(&self);
1059 );
1060}
1061
1062#[cfg(all(feature = "UIResponder", feature = "UIStateRestoration"))]
1063extern_conformance!(
1064 unsafe impl UIStateRestoring for UIViewController {}
1065);
1066
1067#[cfg(feature = "UIResponder")]
1069impl UIViewController {
1070 extern_methods!(
1071 #[unsafe(method(updateViewConstraints))]
1072 #[unsafe(method_family = none)]
1073 pub unsafe fn updateViewConstraints(&self);
1074 );
1075}
1076
1077#[cfg(feature = "UIResponder")]
1079impl UIViewController {
1080 extern_methods!(
1081 #[cfg(feature = "UIViewControllerTransitioning")]
1082 #[unsafe(method(transitioningDelegate))]
1083 #[unsafe(method_family = none)]
1084 pub unsafe fn transitioningDelegate(
1085 &self,
1086 ) -> Option<Retained<ProtocolObject<dyn UIViewControllerTransitioningDelegate>>>;
1087
1088 #[cfg(feature = "UIViewControllerTransitioning")]
1089 #[unsafe(method(setTransitioningDelegate:))]
1092 #[unsafe(method_family = none)]
1093 pub unsafe fn setTransitioningDelegate(
1094 &self,
1095 transitioning_delegate: Option<
1096 &ProtocolObject<dyn UIViewControllerTransitioningDelegate>,
1097 >,
1098 );
1099 );
1100}
1101
1102#[cfg(feature = "UIResponder")]
1104impl UIViewController {
1105 extern_methods!(
1106 #[cfg(feature = "NSLayoutConstraint")]
1107 #[deprecated = "Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor"]
1108 #[unsafe(method(topLayoutGuide))]
1109 #[unsafe(method_family = none)]
1110 pub unsafe fn topLayoutGuide(&self) -> Retained<ProtocolObject<dyn UILayoutSupport>>;
1111
1112 #[cfg(feature = "NSLayoutConstraint")]
1113 #[deprecated = "Use view.safeAreaLayoutGuide.bottomAnchor instead of bottomLayoutGuide.topAnchor"]
1114 #[unsafe(method(bottomLayoutGuide))]
1115 #[unsafe(method_family = none)]
1116 pub unsafe fn bottomLayoutGuide(&self) -> Retained<ProtocolObject<dyn UILayoutSupport>>;
1117
1118 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1119 #[unsafe(method(additionalSafeAreaInsets))]
1120 #[unsafe(method_family = none)]
1121 pub unsafe fn additionalSafeAreaInsets(&self) -> UIEdgeInsets;
1122
1123 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1124 #[unsafe(method(setAdditionalSafeAreaInsets:))]
1126 #[unsafe(method_family = none)]
1127 pub unsafe fn setAdditionalSafeAreaInsets(&self, additional_safe_area_insets: UIEdgeInsets);
1128
1129 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1130 #[unsafe(method(systemMinimumLayoutMargins))]
1131 #[unsafe(method_family = none)]
1132 pub unsafe fn systemMinimumLayoutMargins(&self) -> NSDirectionalEdgeInsets;
1133
1134 #[unsafe(method(viewRespectsSystemMinimumLayoutMargins))]
1135 #[unsafe(method_family = none)]
1136 pub unsafe fn viewRespectsSystemMinimumLayoutMargins(&self) -> bool;
1137
1138 #[unsafe(method(setViewRespectsSystemMinimumLayoutMargins:))]
1140 #[unsafe(method_family = none)]
1141 pub unsafe fn setViewRespectsSystemMinimumLayoutMargins(
1142 &self,
1143 view_respects_system_minimum_layout_margins: bool,
1144 );
1145
1146 #[unsafe(method(viewLayoutMarginsDidChange))]
1147 #[unsafe(method_family = none)]
1148 pub unsafe fn viewLayoutMarginsDidChange(&self);
1149
1150 #[unsafe(method(viewSafeAreaInsetsDidChange))]
1151 #[unsafe(method_family = none)]
1152 pub unsafe fn viewSafeAreaInsetsDidChange(&self);
1153 );
1154}
1155
1156#[cfg(feature = "UIResponder")]
1158impl UIViewController {
1159 extern_methods!(
1160 #[cfg(all(
1161 feature = "UICommand",
1162 feature = "UIKeyCommand",
1163 feature = "UIMenuElement"
1164 ))]
1165 #[unsafe(method(addKeyCommand:))]
1166 #[unsafe(method_family = none)]
1167 pub unsafe fn addKeyCommand(&self, key_command: &UIKeyCommand);
1168
1169 #[cfg(all(
1170 feature = "UICommand",
1171 feature = "UIKeyCommand",
1172 feature = "UIMenuElement"
1173 ))]
1174 #[unsafe(method(removeKeyCommand:))]
1175 #[unsafe(method_family = none)]
1176 pub unsafe fn removeKeyCommand(&self, key_command: &UIKeyCommand);
1177 );
1178}
1179
1180#[cfg(feature = "UIResponder")]
1182impl UIViewController {
1183 extern_methods!(
1184 #[unsafe(method(performsActionsWhilePresentingModally))]
1188 #[unsafe(method_family = none)]
1189 pub unsafe fn performsActionsWhilePresentingModally(&self) -> bool;
1190 );
1191}
1192
1193#[cfg(feature = "UIResponder")]
1195impl UIViewController {
1196 extern_methods!(
1197 #[unsafe(method(extensionContext))]
1198 #[unsafe(method_family = none)]
1199 pub unsafe fn extensionContext(&self) -> Option<Retained<NSExtensionContext>>;
1200 );
1201}
1202
1203#[cfg(feature = "UIResponder")]
1204extern_conformance!(
1205 unsafe impl NSExtensionRequestHandling for UIViewController {}
1206);
1207
1208#[cfg(feature = "UIResponder")]
1210impl UIViewController {
1211 extern_methods!(
1212 #[cfg(feature = "UIPresentationController")]
1213 #[unsafe(method(presentationController))]
1214 #[unsafe(method_family = none)]
1215 pub unsafe fn presentationController(&self) -> Option<Retained<UIPresentationController>>;
1216
1217 #[cfg(all(
1218 feature = "UIPresentationController",
1219 feature = "UISheetPresentationController"
1220 ))]
1221 #[unsafe(method(sheetPresentationController))]
1222 #[unsafe(method_family = none)]
1223 pub unsafe fn sheetPresentationController(
1224 &self,
1225 ) -> Option<Retained<UISheetPresentationController>>;
1226
1227 #[cfg(all(
1228 feature = "UIPopoverPresentationController",
1229 feature = "UIPresentationController"
1230 ))]
1231 #[unsafe(method(popoverPresentationController))]
1232 #[unsafe(method_family = none)]
1233 pub unsafe fn popoverPresentationController(
1234 &self,
1235 ) -> Option<Retained<UIPopoverPresentationController>>;
1236
1237 #[cfg(feature = "UIPresentationController")]
1238 #[unsafe(method(activePresentationController))]
1239 #[unsafe(method_family = none)]
1240 pub unsafe fn activePresentationController(
1241 &self,
1242 ) -> Option<Retained<UIPresentationController>>;
1243
1244 #[unsafe(method(isModalInPresentation))]
1245 #[unsafe(method_family = none)]
1246 pub unsafe fn isModalInPresentation(&self) -> bool;
1247
1248 #[unsafe(method(setModalInPresentation:))]
1250 #[unsafe(method_family = none)]
1251 pub unsafe fn setModalInPresentation(&self, modal_in_presentation: bool);
1252 );
1253}
1254
1255extern_protocol!(
1256 pub unsafe trait UIViewControllerPreviewing: NSObjectProtocol + MainThreadOnly {
1258 #[cfg(feature = "UIGestureRecognizer")]
1259 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1260 #[unsafe(method(previewingGestureRecognizerForFailureRelationship))]
1261 #[unsafe(method_family = none)]
1262 unsafe fn previewingGestureRecognizerForFailureRelationship(
1263 &self,
1264 ) -> Retained<UIGestureRecognizer>;
1265
1266 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1267 #[unsafe(method(delegate))]
1268 #[unsafe(method_family = none)]
1269 unsafe fn delegate(
1270 &self,
1271 ) -> Retained<ProtocolObject<dyn UIViewControllerPreviewingDelegate>>;
1272
1273 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
1274 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1275 #[unsafe(method(sourceView))]
1276 #[unsafe(method_family = none)]
1277 unsafe fn sourceView(&self) -> Retained<UIView>;
1278
1279 #[cfg(feature = "objc2-core-foundation")]
1280 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1281 #[unsafe(method(sourceRect))]
1282 #[unsafe(method_family = none)]
1283 unsafe fn sourceRect(&self) -> CGRect;
1284
1285 #[cfg(feature = "objc2-core-foundation")]
1286 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1288 #[unsafe(method(setSourceRect:))]
1289 #[unsafe(method_family = none)]
1290 unsafe fn setSourceRect(&self, source_rect: CGRect);
1291 }
1292);
1293
1294extern_protocol!(
1295 pub unsafe trait UIViewControllerPreviewingDelegate:
1297 NSObjectProtocol + MainThreadOnly
1298 {
1299 #[cfg(all(feature = "UIResponder", feature = "objc2-core-foundation"))]
1300 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1301 #[unsafe(method(previewingContext:viewControllerForLocation:))]
1302 #[unsafe(method_family = none)]
1303 unsafe fn previewingContext_viewControllerForLocation(
1304 &self,
1305 previewing_context: &ProtocolObject<dyn UIViewControllerPreviewing>,
1306 location: CGPoint,
1307 ) -> Option<Retained<UIViewController>>;
1308
1309 #[cfg(feature = "UIResponder")]
1310 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1311 #[unsafe(method(previewingContext:commitViewController:))]
1312 #[unsafe(method_family = none)]
1313 unsafe fn previewingContext_commitViewController(
1314 &self,
1315 previewing_context: &ProtocolObject<dyn UIViewControllerPreviewing>,
1316 view_controller_to_commit: &UIViewController,
1317 );
1318 }
1319);
1320
1321#[cfg(feature = "UIResponder")]
1323impl UIViewController {
1324 extern_methods!(
1325 #[cfg(feature = "UIView")]
1326 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1327 #[unsafe(method(registerForPreviewingWithDelegate:sourceView:))]
1328 #[unsafe(method_family = none)]
1329 pub unsafe fn registerForPreviewingWithDelegate_sourceView(
1330 &self,
1331 delegate: &ProtocolObject<dyn UIViewControllerPreviewingDelegate>,
1332 source_view: &UIView,
1333 ) -> Retained<ProtocolObject<dyn UIViewControllerPreviewing>>;
1334
1335 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1336 #[unsafe(method(unregisterForPreviewingWithContext:))]
1337 #[unsafe(method_family = none)]
1338 pub unsafe fn unregisterForPreviewingWithContext(
1339 &self,
1340 previewing: &ProtocolObject<dyn UIViewControllerPreviewing>,
1341 );
1342 );
1343}
1344
1345#[cfg(feature = "UIResponder")]
1347impl UIViewController {
1348 extern_methods!(
1349 #[unsafe(method(childViewControllerForScreenEdgesDeferringSystemGestures))]
1350 #[unsafe(method_family = none)]
1351 pub unsafe fn childViewControllerForScreenEdgesDeferringSystemGestures(
1352 &self,
1353 ) -> Option<Retained<UIViewController>>;
1354
1355 #[cfg(feature = "UIGeometry")]
1356 #[unsafe(method(preferredScreenEdgesDeferringSystemGestures))]
1357 #[unsafe(method_family = none)]
1358 pub unsafe fn preferredScreenEdgesDeferringSystemGestures(&self) -> UIRectEdge;
1359
1360 #[unsafe(method(setNeedsUpdateOfScreenEdgesDeferringSystemGestures))]
1361 #[unsafe(method_family = none)]
1362 pub fn setNeedsUpdateOfScreenEdgesDeferringSystemGestures(&self);
1363 );
1364}
1365
1366#[cfg(feature = "UIResponder")]
1368impl UIViewController {
1369 extern_methods!(
1370 #[unsafe(method(childViewControllerForHomeIndicatorAutoHidden))]
1371 #[unsafe(method_family = none)]
1372 pub unsafe fn childViewControllerForHomeIndicatorAutoHidden(
1373 &self,
1374 ) -> Option<Retained<UIViewController>>;
1375
1376 #[unsafe(method(prefersHomeIndicatorAutoHidden))]
1377 #[unsafe(method_family = none)]
1378 pub unsafe fn prefersHomeIndicatorAutoHidden(&self) -> bool;
1379
1380 #[unsafe(method(setNeedsUpdateOfHomeIndicatorAutoHidden))]
1381 #[unsafe(method_family = none)]
1382 pub fn setNeedsUpdateOfHomeIndicatorAutoHidden(&self);
1383 );
1384}
1385
1386#[cfg(feature = "UIResponder")]
1388impl UIViewController {
1389 extern_methods!(
1390 #[unsafe(method(childViewControllerForPointerLock))]
1391 #[unsafe(method_family = none)]
1392 pub unsafe fn childViewControllerForPointerLock(
1393 &self,
1394 ) -> Option<Retained<UIViewController>>;
1395
1396 #[unsafe(method(prefersPointerLocked))]
1397 #[unsafe(method_family = none)]
1398 pub unsafe fn prefersPointerLocked(&self) -> bool;
1399
1400 #[unsafe(method(setNeedsUpdateOfPrefersPointerLocked))]
1401 #[unsafe(method_family = none)]
1402 pub unsafe fn setNeedsUpdateOfPrefersPointerLocked(&self);
1403 );
1404}
1405
1406#[cfg(feature = "UIResponder")]
1407impl UIViewController {
1408 extern_methods!(
1409 #[cfg(feature = "UIContentConfiguration")]
1410 #[unsafe(method(contentUnavailableConfiguration))]
1414 #[unsafe(method_family = none)]
1415 pub unsafe fn contentUnavailableConfiguration(
1416 &self,
1417 ) -> Option<Retained<ProtocolObject<dyn UIContentConfiguration>>>;
1418
1419 #[cfg(feature = "UIContentConfiguration")]
1420 #[unsafe(method(setContentUnavailableConfiguration:))]
1422 #[unsafe(method_family = none)]
1423 pub unsafe fn setContentUnavailableConfiguration(
1424 &self,
1425 content_unavailable_configuration: Option<&ProtocolObject<dyn UIContentConfiguration>>,
1426 );
1427
1428 #[cfg(feature = "UIContentUnavailableConfigurationState")]
1429 #[unsafe(method(contentUnavailableConfigurationState))]
1433 #[unsafe(method_family = none)]
1434 pub unsafe fn contentUnavailableConfigurationState(
1435 &self,
1436 ) -> Retained<UIContentUnavailableConfigurationState>;
1437
1438 #[unsafe(method(setNeedsUpdateContentUnavailableConfiguration))]
1442 #[unsafe(method_family = none)]
1443 pub unsafe fn setNeedsUpdateContentUnavailableConfiguration(&self);
1444
1445 #[cfg(feature = "UIContentUnavailableConfigurationState")]
1446 #[unsafe(method(updateContentUnavailableConfigurationUsingState:))]
1449 #[unsafe(method_family = none)]
1450 pub unsafe fn updateContentUnavailableConfigurationUsingState(
1451 &self,
1452 state: &UIContentUnavailableConfigurationState,
1453 );
1454 );
1455}
1456
1457#[cfg(feature = "UIResponder")]
1458impl UIViewController {
1459 extern_methods!(
1460 #[deprecated = "UIViewControllerPreviewing is deprecated. Please use UIContextMenuInteraction."]
1461 #[unsafe(method(previewActionItems))]
1462 #[unsafe(method_family = none)]
1463 pub unsafe fn previewActionItems(
1464 &self,
1465 ) -> Retained<NSArray<ProtocolObject<dyn UIPreviewActionItem>>>;
1466 );
1467}
1468
1469#[cfg(feature = "UIResponder")]
1470impl UIViewController {
1471 extern_methods!(
1472 #[cfg(feature = "UITraitCollection")]
1473 #[unsafe(method(traitOverrides))]
1474 #[unsafe(method_family = none)]
1475 pub unsafe fn traitOverrides(&self) -> Retained<ProtocolObject<dyn UITraitOverrides>>;
1476
1477 #[unsafe(method(updateTraitsIfNeeded))]
1480 #[unsafe(method_family = none)]
1481 pub unsafe fn updateTraitsIfNeeded(&self);
1482 );
1483}
1484
1485#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
1486extern_conformance!(
1487 unsafe impl UITraitChangeObservable for UIViewController {}
1488);
1489
1490#[repr(transparent)]
1493#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1494pub struct UIContainerBackgroundStyle(pub NSInteger);
1495impl UIContainerBackgroundStyle {
1496 #[doc(alias = "UIContainerBackgroundStyleAutomatic")]
1497 pub const Automatic: Self = Self(0);
1498 #[doc(alias = "UIContainerBackgroundStyleGlass")]
1499 pub const Glass: Self = Self(1);
1500 #[doc(alias = "UIContainerBackgroundStyleHidden")]
1501 pub const Hidden: Self = Self(2);
1502}
1503
1504unsafe impl Encode for UIContainerBackgroundStyle {
1505 const ENCODING: Encoding = NSInteger::ENCODING;
1506}
1507
1508unsafe impl RefEncode for UIContainerBackgroundStyle {
1509 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1510}
1511
1512#[cfg(feature = "UIResponder")]
1513impl UIViewController {
1514 extern_methods!(
1515 #[unsafe(method(preferredContainerBackgroundStyle))]
1516 #[unsafe(method_family = none)]
1517 pub unsafe fn preferredContainerBackgroundStyle(&self) -> UIContainerBackgroundStyle;
1518
1519 #[unsafe(method(childViewControllerForPreferredContainerBackgroundStyle))]
1520 #[unsafe(method_family = none)]
1521 pub unsafe fn childViewControllerForPreferredContainerBackgroundStyle(
1522 &self,
1523 ) -> Option<Retained<UIViewController>>;
1524
1525 #[unsafe(method(setNeedsUpdateOfPreferredContainerBackgroundStyle))]
1526 #[unsafe(method_family = none)]
1527 pub unsafe fn setNeedsUpdateOfPreferredContainerBackgroundStyle(&self);
1528 );
1529}
1530
1531extern_protocol!(
1532 pub unsafe trait UIPreviewActionItem: NSObjectProtocol + MainThreadOnly {
1534 #[unsafe(method(title))]
1535 #[unsafe(method_family = none)]
1536 unsafe fn title(&self) -> Retained<NSString>;
1537 }
1538);
1539
1540#[deprecated = "Please use UIContextMenuInteraction."]
1543#[repr(transparent)]
1544#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1545pub struct UIPreviewActionStyle(pub NSInteger);
1546impl UIPreviewActionStyle {
1547 #[doc(alias = "UIPreviewActionStyleDefault")]
1548 #[deprecated = "Please use UIContextMenuInteraction."]
1549 pub const Default: Self = Self(0);
1550 #[doc(alias = "UIPreviewActionStyleSelected")]
1551 #[deprecated = "Please use UIContextMenuInteraction."]
1552 pub const Selected: Self = Self(1);
1553 #[doc(alias = "UIPreviewActionStyleDestructive")]
1554 #[deprecated = "Please use UIContextMenuInteraction."]
1555 pub const Destructive: Self = Self(2);
1556}
1557
1558unsafe impl Encode for UIPreviewActionStyle {
1559 const ENCODING: Encoding = NSInteger::ENCODING;
1560}
1561
1562unsafe impl RefEncode for UIPreviewActionStyle {
1563 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1564}
1565
1566extern_class!(
1567 #[unsafe(super(NSObject))]
1569 #[thread_kind = MainThreadOnly]
1570 #[derive(Debug, PartialEq, Eq, Hash)]
1571 #[deprecated = "Please use UIContextMenuInteraction."]
1572 pub struct UIPreviewAction;
1573);
1574
1575extern_conformance!(
1576 unsafe impl NSCopying for UIPreviewAction {}
1577);
1578
1579unsafe impl CopyingHelper for UIPreviewAction {
1580 type Result = Self;
1581}
1582
1583extern_conformance!(
1584 unsafe impl NSObjectProtocol for UIPreviewAction {}
1585);
1586
1587extern_conformance!(
1588 unsafe impl UIPreviewActionItem for UIPreviewAction {}
1589);
1590
1591impl UIPreviewAction {
1592 extern_methods!(
1593 #[cfg(all(feature = "UIResponder", feature = "block2"))]
1594 #[unsafe(method(handler))]
1595 #[unsafe(method_family = none)]
1596 pub unsafe fn handler(
1597 &self,
1598 ) -> NonNull<
1599 block2::DynBlock<
1600 dyn Fn(NonNull<ProtocolObject<dyn UIPreviewActionItem>>, NonNull<UIViewController>),
1601 >,
1602 >;
1603
1604 #[cfg(all(feature = "UIResponder", feature = "block2"))]
1605 #[unsafe(method(actionWithTitle:style:handler:))]
1606 #[unsafe(method_family = none)]
1607 pub unsafe fn actionWithTitle_style_handler(
1608 title: &NSString,
1609 style: UIPreviewActionStyle,
1610 handler: &block2::DynBlock<dyn Fn(NonNull<UIPreviewAction>, NonNull<UIViewController>)>,
1611 mtm: MainThreadMarker,
1612 ) -> Retained<Self>;
1613 );
1614}
1615
1616impl UIPreviewAction {
1618 extern_methods!(
1619 #[unsafe(method(init))]
1620 #[unsafe(method_family = init)]
1621 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1622
1623 #[unsafe(method(new))]
1624 #[unsafe(method_family = new)]
1625 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1626 );
1627}
1628
1629extern_class!(
1630 #[unsafe(super(NSObject))]
1632 #[thread_kind = MainThreadOnly]
1633 #[derive(Debug, PartialEq, Eq, Hash)]
1634 #[deprecated = "Please use UIContextMenuInteraction."]
1635 pub struct UIPreviewActionGroup;
1636);
1637
1638extern_conformance!(
1639 unsafe impl NSCopying for UIPreviewActionGroup {}
1640);
1641
1642unsafe impl CopyingHelper for UIPreviewActionGroup {
1643 type Result = Self;
1644}
1645
1646extern_conformance!(
1647 unsafe impl NSObjectProtocol for UIPreviewActionGroup {}
1648);
1649
1650extern_conformance!(
1651 unsafe impl UIPreviewActionItem for UIPreviewActionGroup {}
1652);
1653
1654impl UIPreviewActionGroup {
1655 extern_methods!(
1656 #[unsafe(method(actionGroupWithTitle:style:actions:))]
1657 #[unsafe(method_family = none)]
1658 pub unsafe fn actionGroupWithTitle_style_actions(
1659 title: &NSString,
1660 style: UIPreviewActionStyle,
1661 actions: &NSArray<UIPreviewAction>,
1662 mtm: MainThreadMarker,
1663 ) -> Retained<Self>;
1664 );
1665}
1666
1667impl UIPreviewActionGroup {
1669 extern_methods!(
1670 #[unsafe(method(init))]
1671 #[unsafe(method_family = init)]
1672 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1673
1674 #[unsafe(method(new))]
1675 #[unsafe(method_family = new)]
1676 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1677 );
1678}