objc2_ui_kit/generated/
UITabBarController.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitabbarcontrollermode?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UITabBarControllerMode(pub NSInteger);
15impl UITabBarControllerMode {
16    /// The default tab bar controller mode.
17    /// Resolves to `tabSidebar` if any of the tab elements of the tab bar controller is a group, and
18    /// if the platform supports displaying a sidebar mode. Otherwise, resolves to `tabBar`.
19    #[doc(alias = "UITabBarControllerModeAutomatic")]
20    pub const Automatic: Self = Self(0);
21    /// Displays tabs in a tab bar.
22    #[doc(alias = "UITabBarControllerModeTabBar")]
23    pub const TabBar: Self = Self(1);
24    /// Displays tabs in a tab bar and sidebar.
25    #[doc(alias = "UITabBarControllerModeTabSidebar")]
26    pub const TabSidebar: Self = Self(2);
27}
28
29unsafe impl Encode for UITabBarControllerMode {
30    const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for UITabBarControllerMode {
34    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitabbarminimizebehavior?language=objc)
38// NS_ENUM
39#[repr(transparent)]
40#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
41pub struct UITabBarMinimizeBehavior(pub NSInteger);
42impl UITabBarMinimizeBehavior {
43    /// Resolves to the system default minimize behavior.
44    #[doc(alias = "UITabBarMinimizeBehaviorAutomatic")]
45    pub const Automatic: Self = Self(0);
46    /// The tab bar does not minimize.
47    #[doc(alias = "UITabBarMinimizeBehaviorNever")]
48    pub const Never: Self = Self(1);
49    /// The tab bar minimizes when scrolling down, and expands when scrolling back up.
50    #[doc(alias = "UITabBarMinimizeBehaviorOnScrollDown")]
51    pub const OnScrollDown: Self = Self(2);
52    /// The tab bar minimizes when scrolling up, and expands when scrolling back down.
53    /// Recommended if the scroll view content is aligned to the bottom.
54    #[doc(alias = "UITabBarMinimizeBehaviorOnScrollUp")]
55    pub const OnScrollUp: Self = Self(3);
56}
57
58unsafe impl Encode for UITabBarMinimizeBehavior {
59    const ENCODING: Encoding = NSInteger::ENCODING;
60}
61
62unsafe impl RefEncode for UITabBarMinimizeBehavior {
63    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
64}
65
66extern_class!(
67    /// UITabBarController manages a button bar and transition view, for an application with multiple top-level modes.
68    ///
69    /// To use in your application, add its view to the view hierarchy, then add top-level view controllers in order.
70    /// Most clients will not need to subclass UITabBarController.
71    ///
72    /// If more than five view controllers are added to a tab bar controller, only the first four will display.
73    /// The rest will be accessible under an automatically generated More item.
74    ///
75    /// UITabBarController is rotatable if all of its view controllers are rotatable.
76    ///
77    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller?language=objc)
78    #[unsafe(super(UIViewController, UIResponder, NSObject))]
79    #[thread_kind = MainThreadOnly]
80    #[derive(Debug, PartialEq, Eq, Hash)]
81    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
82    pub struct UITabBarController;
83);
84
85#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
86extern_conformance!(
87    unsafe impl NSCoding for UITabBarController {}
88);
89
90#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
91extern_conformance!(
92    unsafe impl NSObjectProtocol for UITabBarController {}
93);
94
95#[cfg(all(
96    feature = "UIAppearance",
97    feature = "UIResponder",
98    feature = "UIViewController"
99))]
100extern_conformance!(
101    unsafe impl UIAppearanceContainer for UITabBarController {}
102);
103
104#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
105extern_conformance!(
106    unsafe impl UIContentContainer for UITabBarController {}
107);
108
109#[cfg(all(
110    feature = "UIFocus",
111    feature = "UIResponder",
112    feature = "UIViewController"
113))]
114extern_conformance!(
115    unsafe impl UIFocusEnvironment for UITabBarController {}
116);
117
118#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
119extern_conformance!(
120    unsafe impl UIResponderStandardEditActions for UITabBarController {}
121);
122
123#[cfg(all(
124    feature = "UIResponder",
125    feature = "UITabBar",
126    feature = "UIViewController"
127))]
128extern_conformance!(
129    unsafe impl UITabBarDelegate for UITabBarController {}
130);
131
132#[cfg(all(
133    feature = "UIResponder",
134    feature = "UITraitCollection",
135    feature = "UIViewController"
136))]
137extern_conformance!(
138    unsafe impl UITraitEnvironment for UITabBarController {}
139);
140
141#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
142impl UITabBarController {
143    extern_methods!(
144        /// The object managing the delegate of the tab bar controller.
145        ///
146        /// The default value for this property is `nil`.
147        #[unsafe(method(delegate))]
148        #[unsafe(method_family = none)]
149        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UITabBarControllerDelegate>>>;
150
151        /// Setter for [`delegate`][Self::delegate].
152        ///
153        /// This is a [weak property][objc2::topics::weak_property].
154        #[unsafe(method(setDelegate:))]
155        #[unsafe(method_family = none)]
156        pub fn setDelegate(
157            &self,
158            delegate: Option<&ProtocolObject<dyn UITabBarControllerDelegate>>,
159        );
160
161        /// The object managing the tab sidebar for the tab bar controller.
162        ///
163        /// The default value for this property is `UITabBarControllerModeAutomatic`.
164        #[unsafe(method(mode))]
165        #[unsafe(method_family = none)]
166        pub fn mode(&self) -> UITabBarControllerMode;
167
168        /// Setter for [`mode`][Self::mode].
169        #[unsafe(method(setMode:))]
170        #[unsafe(method_family = none)]
171        pub fn setMode(&self, mode: UITabBarControllerMode);
172
173        #[cfg(feature = "UITabBarControllerSidebar")]
174        /// The object managing the tab sidebar for the tab bar controller.
175        #[unsafe(method(sidebar))]
176        #[unsafe(method_family = none)]
177        pub fn sidebar(&self) -> Retained<UITabBarControllerSidebar>;
178
179        /// The customization identifier for the tab bar and sidebar for persistence.
180        ///
181        /// The identifier is useful for when an app has multiple tab bar controllers, each with their own customizations.
182        /// If the customization identifier is `nil`, a system default is used. Default is `nil`.
183        #[unsafe(method(customizationIdentifier))]
184        #[unsafe(method_family = none)]
185        pub fn customizationIdentifier(&self) -> Option<Retained<NSString>>;
186
187        /// Setter for [`customizationIdentifier`][Self::customizationIdentifier].
188        ///
189        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
190        #[unsafe(method(setCustomizationIdentifier:))]
191        #[unsafe(method_family = none)]
192        pub fn setCustomizationIdentifier(&self, customization_identifier: Option<&NSString>);
193
194        /// An optional filter to display only select root-level tabs when in a compact appearance.
195        ///
196        /// The default value is is `nil`, which would make all tabs available.
197        #[unsafe(method(compactTabIdentifiers))]
198        #[unsafe(method_family = none)]
199        pub fn compactTabIdentifiers(&self) -> Option<Retained<NSArray<NSString>>>;
200
201        /// Setter for [`compactTabIdentifiers`][Self::compactTabIdentifiers].
202        ///
203        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
204        #[unsafe(method(setCompactTabIdentifiers:))]
205        #[unsafe(method_family = none)]
206        pub fn setCompactTabIdentifiers(&self, compact_tab_identifiers: Option<&NSArray<NSString>>);
207
208        #[cfg(feature = "UITab")]
209        /// The currently selected tab, which can be a root tab or any of their descendants.
210        ///
211        /// The default value for this property is `nil`.
212        #[unsafe(method(selectedTab))]
213        #[unsafe(method_family = none)]
214        pub fn selectedTab(&self) -> Option<Retained<UITab>>;
215
216        #[cfg(feature = "UITab")]
217        /// Setter for [`selectedTab`][Self::selectedTab].
218        #[unsafe(method(setSelectedTab:))]
219        #[unsafe(method_family = none)]
220        pub fn setSelectedTab(&self, selected_tab: Option<&UITab>);
221
222        #[cfg(feature = "UITab")]
223        /// An array of root tabs representing view controllers to display by the tab bar interface.
224        ///
225        /// Once set, `UITabBarController.viewControllers` and related properties and methods will not be called.
226        #[unsafe(method(tabs))]
227        #[unsafe(method_family = none)]
228        pub fn tabs(&self) -> Retained<NSArray<UITab>>;
229
230        #[cfg(feature = "UITab")]
231        /// Setter for [`tabs`][Self::tabs].
232        ///
233        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
234        #[unsafe(method(setTabs:))]
235        #[unsafe(method_family = none)]
236        pub fn setTabs(&self, tabs: &NSArray<UITab>);
237
238        #[cfg(feature = "UITab")]
239        /// Sets the root tabs of the tab bar controller, with an option to animate the change.
240        #[unsafe(method(setTabs:animated:))]
241        #[unsafe(method_family = none)]
242        pub fn setTabs_animated(&self, tabs: &NSArray<UITab>, animated: bool);
243
244        #[cfg(feature = "UITab")]
245        /// Returns the `tab` matching the specified `identifier` in the tab bar controller's tabs. Returns nil if no tab is found matching the `identifier`.
246        #[unsafe(method(tabForIdentifier:))]
247        #[unsafe(method_family = none)]
248        pub fn tabForIdentifier(&self, identifier: &NSString) -> Option<Retained<UITab>>;
249
250        #[cfg(feature = "UITab")]
251        /// Creates a tab bar controller with the specified tabs.
252        #[unsafe(method(initWithTabs:))]
253        #[unsafe(method_family = init)]
254        pub fn initWithTabs(this: Allocated<Self>, tabs: &NSArray<UITab>) -> Retained<Self>;
255
256        /// Defines the minimize behavior for the tab bar, if it is supported.
257        ///
258        /// The default value for this property is `UITabBarMinimizeBehaviorAutomatic`.
259        #[unsafe(method(tabBarMinimizeBehavior))]
260        #[unsafe(method_family = none)]
261        pub fn tabBarMinimizeBehavior(&self) -> UITabBarMinimizeBehavior;
262
263        /// Setter for [`tabBarMinimizeBehavior`][Self::tabBarMinimizeBehavior].
264        #[unsafe(method(setTabBarMinimizeBehavior:))]
265        #[unsafe(method_family = none)]
266        pub fn setTabBarMinimizeBehavior(
267            &self,
268            tab_bar_minimize_behavior: UITabBarMinimizeBehavior,
269        );
270
271        /// Determines if the active tab bar is currently hidden.
272        ///
273        /// The default value for this property is `NO`.
274        #[unsafe(method(isTabBarHidden))]
275        #[unsafe(method_family = none)]
276        pub fn isTabBarHidden(&self) -> bool;
277
278        /// Setter for [`isTabBarHidden`][Self::isTabBarHidden].
279        #[unsafe(method(setTabBarHidden:))]
280        #[unsafe(method_family = none)]
281        pub fn setTabBarHidden(&self, tab_bar_hidden: bool);
282
283        /// Changes the active tab bar's visibility with an option to animate the change.
284        #[unsafe(method(setTabBarHidden:animated:))]
285        #[unsafe(method_family = none)]
286        pub fn setTabBarHidden_animated(&self, hidden: bool, animated: bool);
287
288        #[cfg(feature = "UILayoutGuide")]
289        /// The content layout guide provides the layout area for the UITabBarController unobscured by the tab bar or sidebar.
290        #[unsafe(method(contentLayoutGuide))]
291        #[unsafe(method_family = none)]
292        pub fn contentLayoutGuide(&self) -> Retained<UILayoutGuide>;
293
294        #[cfg(feature = "UITabAccessory")]
295        /// An optional bottom accessory of the tab bar controller.
296        ///
297        /// The default value for this property is `nil`.
298        #[unsafe(method(bottomAccessory))]
299        #[unsafe(method_family = none)]
300        pub fn bottomAccessory(&self) -> Option<Retained<UITabAccessory>>;
301
302        #[cfg(feature = "UITabAccessory")]
303        /// Setter for [`bottomAccessory`][Self::bottomAccessory].
304        #[unsafe(method(setBottomAccessory:))]
305        #[unsafe(method_family = none)]
306        pub fn setBottomAccessory(&self, bottom_accessory: Option<&UITabAccessory>);
307
308        #[cfg(feature = "UITabAccessory")]
309        /// Sets a bottom accessory with an option to animate the change.
310        #[unsafe(method(setBottomAccessory:animated:))]
311        #[unsafe(method_family = none)]
312        pub fn setBottomAccessory_animated(
313            &self,
314            bottom_accessory: Option<&UITabAccessory>,
315            animated: bool,
316        );
317
318        #[unsafe(method(viewControllers))]
319        #[unsafe(method_family = none)]
320        pub fn viewControllers(&self) -> Option<Retained<NSArray<UIViewController>>>;
321
322        /// Setter for [`viewControllers`][Self::viewControllers].
323        ///
324        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
325        #[unsafe(method(setViewControllers:))]
326        #[unsafe(method_family = none)]
327        pub fn setViewControllers(&self, view_controllers: Option<&NSArray<UIViewController>>);
328
329        #[unsafe(method(setViewControllers:animated:))]
330        #[unsafe(method_family = none)]
331        pub fn setViewControllers_animated(
332            &self,
333            view_controllers: Option<&NSArray<UIViewController>>,
334            animated: bool,
335        );
336
337        /// # Safety
338        ///
339        /// This is not retained internally, you must ensure the object is still alive.
340        #[unsafe(method(selectedViewController))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn selectedViewController(&self) -> Option<Retained<UIViewController>>;
343
344        /// Setter for [`selectedViewController`][Self::selectedViewController].
345        ///
346        /// # Safety
347        ///
348        /// This is unretained, you must ensure the object is kept alive while in use.
349        #[unsafe(method(setSelectedViewController:))]
350        #[unsafe(method_family = none)]
351        pub unsafe fn setSelectedViewController(
352            &self,
353            selected_view_controller: Option<&UIViewController>,
354        );
355
356        #[unsafe(method(selectedIndex))]
357        #[unsafe(method_family = none)]
358        pub fn selectedIndex(&self) -> NSUInteger;
359
360        /// Setter for [`selectedIndex`][Self::selectedIndex].
361        #[unsafe(method(setSelectedIndex:))]
362        #[unsafe(method_family = none)]
363        pub fn setSelectedIndex(&self, selected_index: NSUInteger);
364
365        #[cfg(feature = "UINavigationController")]
366        #[unsafe(method(moreNavigationController))]
367        #[unsafe(method_family = none)]
368        pub fn moreNavigationController(&self) -> Retained<UINavigationController>;
369
370        #[unsafe(method(customizableViewControllers))]
371        #[unsafe(method_family = none)]
372        pub fn customizableViewControllers(&self) -> Option<Retained<NSArray<UIViewController>>>;
373
374        /// Setter for [`customizableViewControllers`][Self::customizableViewControllers].
375        ///
376        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
377        #[unsafe(method(setCustomizableViewControllers:))]
378        #[unsafe(method_family = none)]
379        pub fn setCustomizableViewControllers(
380            &self,
381            customizable_view_controllers: Option<&NSArray<UIViewController>>,
382        );
383
384        #[cfg(all(feature = "UITabBar", feature = "UIView"))]
385        #[unsafe(method(tabBar))]
386        #[unsafe(method_family = none)]
387        pub fn tabBar(&self) -> Retained<UITabBar>;
388    );
389}
390
391/// Methods declared on superclass `UIViewController`.
392#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
393impl UITabBarController {
394    extern_methods!(
395        #[unsafe(method(initWithNibName:bundle:))]
396        #[unsafe(method_family = init)]
397        pub fn initWithNibName_bundle(
398            this: Allocated<Self>,
399            nib_name_or_nil: Option<&NSString>,
400            nib_bundle_or_nil: Option<&NSBundle>,
401        ) -> Retained<Self>;
402
403        /// # Safety
404        ///
405        /// `coder` possibly has further requirements.
406        #[unsafe(method(initWithCoder:))]
407        #[unsafe(method_family = init)]
408        pub unsafe fn initWithCoder(
409            this: Allocated<Self>,
410            coder: &NSCoder,
411        ) -> Option<Retained<Self>>;
412    );
413}
414
415/// Methods declared on superclass `NSObject`.
416#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
417impl UITabBarController {
418    extern_methods!(
419        #[unsafe(method(init))]
420        #[unsafe(method_family = init)]
421        pub fn init(this: Allocated<Self>) -> Retained<Self>;
422
423        #[unsafe(method(new))]
424        #[unsafe(method_family = new)]
425        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
426    );
427}
428
429extern_protocol!(
430    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitabbarcontrollerdelegate?language=objc)
431    pub unsafe trait UITabBarControllerDelegate: NSObjectProtocol + MainThreadOnly {
432        #[cfg(all(
433            feature = "UIResponder",
434            feature = "UITab",
435            feature = "UIViewController"
436        ))]
437        /// Asks the delegate whether the specified tab should be made active.
438        ///
439        /// Return
440        /// `YES`if the specified
441        /// `tab`can be selected by the user. Otherwise, return
442        /// `NO`
443        #[optional]
444        #[unsafe(method(tabBarController:shouldSelectTab:))]
445        #[unsafe(method_family = none)]
446        fn tabBarController_shouldSelectTab(
447            &self,
448            tab_bar_controller: &UITabBarController,
449            tab: &UITab,
450        ) -> bool;
451
452        #[cfg(all(
453            feature = "UIResponder",
454            feature = "UITab",
455            feature = "UIViewController"
456        ))]
457        /// Tells the delegate that the user selected the specified
458        /// `selectedTab`in the tab bar controller.
459        ///
460        /// This specified
461        /// `selectedTab`is either a root tab or any of their descendants.
462        #[optional]
463        #[unsafe(method(tabBarController:didSelectTab:previousTab:))]
464        #[unsafe(method_family = none)]
465        fn tabBarController_didSelectTab_previousTab(
466            &self,
467            tab_bar_controller: &UITabBarController,
468            selected_tab: &UITab,
469            previous_tab: Option<&UITab>,
470        );
471
472        #[cfg(all(
473            feature = "UIDragSession",
474            feature = "UIDropInteraction",
475            feature = "UIResponder",
476            feature = "UITab",
477            feature = "UIViewController"
478        ))]
479        /// Asks the delegate for a drop operation to determine if drag items can be dropped into the specified
480        /// `tab`
481        /// If the operation is either a `.move` or `.copy`, then the drop will proceed and `tabBarController:tab:acceptItemsFromDropSession:`
482        /// is called. By default, the drop will be treated as a cancel operation if this is not implemented.
483        #[optional]
484        #[unsafe(method(tabBarController:tab:operationForAcceptingItemsFromDropSession:))]
485        #[unsafe(method_family = none)]
486        fn tabBarController_tab_operationForAcceptingItemsFromDropSession(
487            &self,
488            tab_bar_controller: &UITabBarController,
489            tab: &UITab,
490            session: &ProtocolObject<dyn UIDropSession>,
491        ) -> UIDropOperation;
492
493        #[cfg(all(
494            feature = "UIDragSession",
495            feature = "UIResponder",
496            feature = "UITab",
497            feature = "UIViewController"
498        ))]
499        /// Notifies the delegate to perform a drop into the specified
500        /// `tab`from the specified session.
501        ///
502        /// This is only called if the operation returned from `tabBarController:tab:operationForAcceptingItemsFromDropSession` is valid for a drop.
503        #[optional]
504        #[unsafe(method(tabBarController:tab:acceptItemsFromDropSession:))]
505        #[unsafe(method_family = none)]
506        fn tabBarController_tab_acceptItemsFromDropSession(
507            &self,
508            tab_bar_controller: &UITabBarController,
509            tab: &UITab,
510            session: &ProtocolObject<dyn UIDropSession>,
511        );
512
513        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
514        /// Notifies the delegate when the tab bar controller is about to begin editing.
515        #[optional]
516        #[unsafe(method(tabBarControllerWillBeginEditing:))]
517        #[unsafe(method_family = none)]
518        fn tabBarControllerWillBeginEditing(&self, tab_bar_controller: &UITabBarController);
519
520        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
521        /// Notifies the delegate when the tab bar controller's current editing state has ended.
522        #[optional]
523        #[unsafe(method(tabBarControllerDidEndEditing:))]
524        #[unsafe(method_family = none)]
525        fn tabBarControllerDidEndEditing(&self, tab_bar_controller: &UITabBarController);
526
527        #[cfg(all(
528            feature = "UIResponder",
529            feature = "UITab",
530            feature = "UIViewController"
531        ))]
532        /// Notifies the delegate when editing has ended and the specified tabs have had their `isHidden` values changed by the user.
533        #[optional]
534        #[unsafe(method(tabBarController:visibilityDidChangeForTabs:))]
535        #[unsafe(method_family = none)]
536        fn tabBarController_visibilityDidChangeForTabs(
537            &self,
538            tab_bar_controller: &UITabBarController,
539            tabs: &NSArray<UITab>,
540        );
541
542        #[cfg(all(
543            feature = "UIResponder",
544            feature = "UITab",
545            feature = "UITabGroup",
546            feature = "UIViewController"
547        ))]
548        /// Notifies the delegate that the display order for the specified tab has been changed by the user.
549        #[optional]
550        #[unsafe(method(tabBarController:displayOrderDidChangeForGroup:))]
551        #[unsafe(method_family = none)]
552        fn tabBarController_displayOrderDidChangeForGroup(
553            &self,
554            tab_bar_controller: &UITabBarController,
555            group: &UITabGroup,
556        );
557
558        #[cfg(all(
559            feature = "UIResponder",
560            feature = "UITab",
561            feature = "UIViewController"
562        ))]
563        /// Used with `UITabGroup.managingNavigationController`, this method allows the delegate to customize the displayed view controllers
564        /// within the navigation stack for each level of selected tab. This method is called by the system if the selected tab in the `UITabBarController`
565        /// belongs to or is in the hierarchy of a managing tab group (i.e. a `UITabGroup` with a non-nil `managingNavigationController`). By default,
566        /// if this method is not implemented, the system will build the navigation stack by adding each tab's `viewController` into the hierarchy, if one exists.
567        /// This is especially useful to hide certain view controllers when transitioning between compact and regular size classes.
568        ///
569        ///
570        /// Parameter `tabBarController`: The tab bar controller managed by the delegate.
571        ///
572        /// Parameter `tab`: The tab for which the displayed view controllers is being requested for by its `managingTabGroup`. Each tab in the selection hierarchy will be called once.
573        ///
574        /// Parameter `proposedViewControllers`: The proposed view controllers for the given tab. In general, the proposed view controller is a single-item array of the tab's viewController. If other view controllers are pushed onto the navigation stack, they will be part of the last (leaf-most) tab's `proposedViewControllers` such that they are preserved between updates.
575        ///
576        ///
577        /// Returns: A list of view controllers represented by the tab in the navigation stack.
578        #[optional]
579        #[unsafe(method(tabBarController:displayedViewControllersForTab:proposedViewControllers:))]
580        #[unsafe(method_family = none)]
581        fn tabBarController_displayedViewControllersForTab_proposedViewControllers(
582            &self,
583            tab_bar_controller: &UITabBarController,
584            tab: &UITab,
585            proposed_view_controllers: &NSArray<UIViewController>,
586        ) -> Retained<NSArray<UIViewController>>;
587
588        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
589        #[optional]
590        #[unsafe(method(tabBarController:shouldSelectViewController:))]
591        #[unsafe(method_family = none)]
592        fn tabBarController_shouldSelectViewController(
593            &self,
594            tab_bar_controller: &UITabBarController,
595            view_controller: &UIViewController,
596        ) -> bool;
597
598        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
599        #[optional]
600        #[unsafe(method(tabBarController:didSelectViewController:))]
601        #[unsafe(method_family = none)]
602        fn tabBarController_didSelectViewController(
603            &self,
604            tab_bar_controller: &UITabBarController,
605            view_controller: &UIViewController,
606        );
607
608        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
609        #[optional]
610        #[unsafe(method(tabBarController:willBeginCustomizingViewControllers:))]
611        #[unsafe(method_family = none)]
612        fn tabBarController_willBeginCustomizingViewControllers(
613            &self,
614            tab_bar_controller: &UITabBarController,
615            view_controllers: &NSArray<UIViewController>,
616        );
617
618        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
619        #[optional]
620        #[unsafe(method(tabBarController:willEndCustomizingViewControllers:changed:))]
621        #[unsafe(method_family = none)]
622        fn tabBarController_willEndCustomizingViewControllers_changed(
623            &self,
624            tab_bar_controller: &UITabBarController,
625            view_controllers: &NSArray<UIViewController>,
626            changed: bool,
627        );
628
629        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
630        #[optional]
631        #[unsafe(method(tabBarController:didEndCustomizingViewControllers:changed:))]
632        #[unsafe(method_family = none)]
633        fn tabBarController_didEndCustomizingViewControllers_changed(
634            &self,
635            tab_bar_controller: &UITabBarController,
636            view_controllers: &NSArray<UIViewController>,
637            changed: bool,
638        );
639
640        #[cfg(all(
641            feature = "UIOrientation",
642            feature = "UIResponder",
643            feature = "UIViewController"
644        ))]
645        #[optional]
646        #[unsafe(method(tabBarControllerSupportedInterfaceOrientations:))]
647        #[unsafe(method_family = none)]
648        fn tabBarControllerSupportedInterfaceOrientations(
649            &self,
650            tab_bar_controller: &UITabBarController,
651        ) -> UIInterfaceOrientationMask;
652
653        #[cfg(all(
654            feature = "UIOrientation",
655            feature = "UIResponder",
656            feature = "UIViewController"
657        ))]
658        #[optional]
659        #[unsafe(method(tabBarControllerPreferredInterfaceOrientationForPresentation:))]
660        #[unsafe(method_family = none)]
661        fn tabBarControllerPreferredInterfaceOrientationForPresentation(
662            &self,
663            tab_bar_controller: &UITabBarController,
664        ) -> UIInterfaceOrientation;
665
666        #[cfg(all(
667            feature = "UIResponder",
668            feature = "UIViewController",
669            feature = "UIViewControllerTransitioning"
670        ))]
671        #[optional]
672        #[unsafe(method(tabBarController:interactionControllerForAnimationController:))]
673        #[unsafe(method_family = none)]
674        fn tabBarController_interactionControllerForAnimationController(
675            &self,
676            tab_bar_controller: &UITabBarController,
677            animation_controller: &ProtocolObject<dyn UIViewControllerAnimatedTransitioning>,
678        ) -> Option<Retained<ProtocolObject<dyn UIViewControllerInteractiveTransitioning>>>;
679
680        #[cfg(all(
681            feature = "UIResponder",
682            feature = "UIViewController",
683            feature = "UIViewControllerTransitioning"
684        ))]
685        #[optional]
686        #[unsafe(method(tabBarController:animationControllerForTransitionFromViewController:toViewController:))]
687        #[unsafe(method_family = none)]
688        fn tabBarController_animationControllerForTransitionFromViewController_toViewController(
689            &self,
690            tab_bar_controller: &UITabBarController,
691            from_vc: &UIViewController,
692            to_vc: &UIViewController,
693        ) -> Option<Retained<ProtocolObject<dyn UIViewControllerAnimatedTransitioning>>>;
694    }
695);
696
697/// UITabBarControllerItem.
698#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
699impl UIViewController {
700    extern_methods!(
701        #[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
702        #[unsafe(method(tabBarItem))]
703        #[unsafe(method_family = none)]
704        pub fn tabBarItem(&self) -> Option<Retained<UITabBarItem>>;
705
706        #[cfg(all(feature = "UIBarItem", feature = "UITabBarItem"))]
707        /// Setter for [`tabBarItem`][Self::tabBarItem].
708        ///
709        /// # Safety
710        ///
711        /// `tab_bar_item` might not allow `None`.
712        #[unsafe(method(setTabBarItem:))]
713        #[unsafe(method_family = none)]
714        pub unsafe fn setTabBarItem(&self, tab_bar_item: Option<&UITabBarItem>);
715
716        #[unsafe(method(tabBarController))]
717        #[unsafe(method_family = none)]
718        pub fn tabBarController(&self) -> Option<Retained<UITabBarController>>;
719
720        #[cfg(all(feature = "UIScrollView", feature = "UIView"))]
721        #[deprecated = "Use -setContentScrollView:forEdge: instead."]
722        #[unsafe(method(tabBarObservedScrollView))]
723        #[unsafe(method_family = none)]
724        pub fn tabBarObservedScrollView(&self) -> Option<Retained<UIScrollView>>;
725
726        #[cfg(all(feature = "UIScrollView", feature = "UIView"))]
727        /// Setter for [`tabBarObservedScrollView`][Self::tabBarObservedScrollView].
728        #[deprecated = "Use -setContentScrollView:forEdge: instead."]
729        #[unsafe(method(setTabBarObservedScrollView:))]
730        #[unsafe(method_family = none)]
731        pub fn setTabBarObservedScrollView(
732            &self,
733            tab_bar_observed_scroll_view: Option<&UIScrollView>,
734        );
735    );
736}