objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uinavigationbarnstoolbarsection?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UINavigationBarNSToolbarSection(pub NSInteger);
impl UINavigationBarNSToolbarSection {
    #[doc(alias = "UINavigationBarNSToolbarSectionNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "UINavigationBarNSToolbarSectionSidebar")]
    pub const Sidebar: Self = Self(1);
    #[doc(alias = "UINavigationBarNSToolbarSectionSupplementary")]
    pub const Supplementary: Self = Self(2);
    #[doc(alias = "UINavigationBarNSToolbarSectionContent")]
    pub const Content: Self = Self(3);
}

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

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

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

#[cfg(all(
    feature = "UIResponder",
    feature = "UIView",
    feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl CALayerDelegate for UINavigationBar {}
);

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

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

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

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

#[cfg(all(feature = "UIBarCommon", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIBarPositioning for UINavigationBar {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UICoordinateSpace for UINavigationBar {}
);

#[cfg(all(
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIDynamicItem for UINavigationBar {}
);

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

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItem for UINavigationBar {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItemContainer for UINavigationBar {}
);

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

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

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UINavigationBar {
    extern_methods!(
        #[cfg(feature = "UIInterface")]
        #[unsafe(method(barStyle))]
        #[unsafe(method_family = none)]
        pub fn barStyle(&self) -> UIBarStyle;

        #[cfg(feature = "UIInterface")]
        /// Setter for [`barStyle`][Self::barStyle].
        #[unsafe(method(setBarStyle:))]
        #[unsafe(method_family = none)]
        pub fn setBarStyle(&self, bar_style: UIBarStyle);

        #[cfg(feature = "UIBarCommon")]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UINavigationBarDelegate>>>;

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

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

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

        #[cfg(feature = "UINavigationItem")]
        #[unsafe(method(pushNavigationItem:animated:))]
        #[unsafe(method_family = none)]
        pub fn pushNavigationItem_animated(&self, item: &UINavigationItem, animated: bool);

        #[cfg(feature = "UINavigationItem")]
        #[unsafe(method(popNavigationItemAnimated:))]
        #[unsafe(method_family = none)]
        pub fn popNavigationItemAnimated(
            &self,
            animated: bool,
        ) -> Option<Retained<UINavigationItem>>;

        #[cfg(feature = "UINavigationItem")]
        #[unsafe(method(topItem))]
        #[unsafe(method_family = none)]
        pub fn topItem(&self) -> Option<Retained<UINavigationItem>>;

        #[cfg(feature = "UINavigationItem")]
        #[unsafe(method(backItem))]
        #[unsafe(method_family = none)]
        pub fn backItem(&self) -> Option<Retained<UINavigationItem>>;

        #[cfg(feature = "UINavigationItem")]
        #[unsafe(method(items))]
        #[unsafe(method_family = none)]
        pub fn items(&self) -> Option<Retained<NSArray<UINavigationItem>>>;

        #[cfg(feature = "UINavigationItem")]
        /// Setter for [`items`][Self::items].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setItems:))]
        #[unsafe(method_family = none)]
        pub fn setItems(&self, items: Option<&NSArray<UINavigationItem>>);

        #[cfg(feature = "UINavigationItem")]
        #[unsafe(method(setItems:animated:))]
        #[unsafe(method_family = none)]
        pub fn setItems_animated(&self, items: Option<&NSArray<UINavigationItem>>, animated: bool);

        /// When set to YES, the navigation bar will use a larger out-of-line title view when requested by the current navigation item. To specify when the large out-of-line title view appears, see UINavigationItem.largeTitleDisplayMode. Defaults to NO.
        #[unsafe(method(prefersLargeTitles))]
        #[unsafe(method_family = none)]
        pub fn prefersLargeTitles(&self) -> bool;

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

        /// The toolbar section that this navigation bar is currently using.
        #[unsafe(method(currentNSToolbarSection))]
        #[unsafe(method_family = none)]
        pub fn currentNSToolbarSection(&self) -> UINavigationBarNSToolbarSection;

        #[cfg(feature = "UIBehavioralStyle")]
        /// The concrete behavioral style chosen for the navigation bar. When this resolves to .mac, the navigation bar's contents are placed in the NSToolbar.
        #[unsafe(method(behavioralStyle))]
        #[unsafe(method_family = none)]
        pub fn behavioralStyle(&self) -> UIBehavioralStyle;

        #[cfg(feature = "UIBehavioralStyle")]
        /// The requested behavioral style for the navigation bar.
        #[unsafe(method(preferredBehavioralStyle))]
        #[unsafe(method_family = none)]
        pub fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;

        #[cfg(feature = "UIBehavioralStyle")]
        /// Setter for [`preferredBehavioralStyle`][Self::preferredBehavioralStyle].
        #[unsafe(method(setPreferredBehavioralStyle:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredBehavioralStyle(&self, preferred_behavioral_style: UIBehavioralStyle);

        #[cfg(feature = "UIColor")]
        #[unsafe(method(tintColor))]
        #[unsafe(method_family = none)]
        pub fn tintColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        /// Setter for [`tintColor`][Self::tintColor].
        ///
        /// # Safety
        ///
        /// `tint_color` might not allow `None`.
        #[unsafe(method(setTintColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);

        #[cfg(feature = "UIColor")]
        #[unsafe(method(barTintColor))]
        #[unsafe(method_family = none)]
        pub fn barTintColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        /// Setter for [`barTintColor`][Self::barTintColor].
        #[unsafe(method(setBarTintColor:))]
        #[unsafe(method_family = none)]
        pub fn setBarTintColor(&self, bar_tint_color: Option<&UIColor>);

        #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
        #[unsafe(method(setBackgroundImage:forBarPosition:barMetrics:))]
        #[unsafe(method_family = none)]
        pub fn setBackgroundImage_forBarPosition_barMetrics(
            &self,
            background_image: Option<&UIImage>,
            bar_position: UIBarPosition,
            bar_metrics: UIBarMetrics,
        );

        #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
        #[unsafe(method(backgroundImageForBarPosition:barMetrics:))]
        #[unsafe(method_family = none)]
        pub fn backgroundImageForBarPosition_barMetrics(
            &self,
            bar_position: UIBarPosition,
            bar_metrics: UIBarMetrics,
        ) -> Option<Retained<UIImage>>;

        #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
        #[unsafe(method(setBackgroundImage:forBarMetrics:))]
        #[unsafe(method_family = none)]
        pub fn setBackgroundImage_forBarMetrics(
            &self,
            background_image: Option<&UIImage>,
            bar_metrics: UIBarMetrics,
        );

        #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
        #[unsafe(method(backgroundImageForBarMetrics:))]
        #[unsafe(method_family = none)]
        pub fn backgroundImageForBarMetrics(
            &self,
            bar_metrics: UIBarMetrics,
        ) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        #[unsafe(method(shadowImage))]
        #[unsafe(method_family = none)]
        pub fn shadowImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        /// Setter for [`shadowImage`][Self::shadowImage].
        #[unsafe(method(setShadowImage:))]
        #[unsafe(method_family = none)]
        pub fn setShadowImage(&self, shadow_image: Option<&UIImage>);

        #[unsafe(method(titleTextAttributes))]
        #[unsafe(method_family = none)]
        pub fn titleTextAttributes(
            &self,
        ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;

        /// Setter for [`titleTextAttributes`][Self::titleTextAttributes].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `title_text_attributes` generic should be of the correct type.
        #[unsafe(method(setTitleTextAttributes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTitleTextAttributes(
            &self,
            title_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
        );

        #[unsafe(method(largeTitleTextAttributes))]
        #[unsafe(method_family = none)]
        pub fn largeTitleTextAttributes(
            &self,
        ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;

        /// Setter for [`largeTitleTextAttributes`][Self::largeTitleTextAttributes].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `large_title_text_attributes` generic should be of the correct type.
        #[unsafe(method(setLargeTitleTextAttributes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLargeTitleTextAttributes(
            &self,
            large_title_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
        );

        #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
        #[unsafe(method(setTitleVerticalPositionAdjustment:forBarMetrics:))]
        #[unsafe(method_family = none)]
        pub fn setTitleVerticalPositionAdjustment_forBarMetrics(
            &self,
            adjustment: CGFloat,
            bar_metrics: UIBarMetrics,
        );

        #[cfg(all(feature = "UIBarCommon", feature = "objc2-core-foundation"))]
        #[unsafe(method(titleVerticalPositionAdjustmentForBarMetrics:))]
        #[unsafe(method_family = none)]
        pub fn titleVerticalPositionAdjustmentForBarMetrics(
            &self,
            bar_metrics: UIBarMetrics,
        ) -> CGFloat;

        #[cfg(feature = "UIImage")]
        #[unsafe(method(backIndicatorImage))]
        #[unsafe(method_family = none)]
        pub fn backIndicatorImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        /// Setter for [`backIndicatorImage`][Self::backIndicatorImage].
        #[unsafe(method(setBackIndicatorImage:))]
        #[unsafe(method_family = none)]
        pub fn setBackIndicatorImage(&self, back_indicator_image: Option<&UIImage>);

        #[cfg(feature = "UIImage")]
        #[unsafe(method(backIndicatorTransitionMaskImage))]
        #[unsafe(method_family = none)]
        pub fn backIndicatorTransitionMaskImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        /// Setter for [`backIndicatorTransitionMaskImage`][Self::backIndicatorTransitionMaskImage].
        #[unsafe(method(setBackIndicatorTransitionMaskImage:))]
        #[unsafe(method_family = none)]
        pub fn setBackIndicatorTransitionMaskImage(
            &self,
            back_indicator_transition_mask_image: Option<&UIImage>,
        );

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Describes the appearance attributes for the navigation bar to use when it is displayed with its standard height.
        #[unsafe(method(standardAppearance))]
        #[unsafe(method_family = none)]
        pub fn standardAppearance(&self) -> Retained<UINavigationBarAppearance>;

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Setter for [`standardAppearance`][Self::standardAppearance].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setStandardAppearance:))]
        #[unsafe(method_family = none)]
        pub fn setStandardAppearance(&self, standard_appearance: &UINavigationBarAppearance);

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Describes the appearance attributes for the navigation bar to use when it is displayed with its compact height. If not set, the standardAppearance will be used instead.
        #[unsafe(method(compactAppearance))]
        #[unsafe(method_family = none)]
        pub fn compactAppearance(&self) -> Option<Retained<UINavigationBarAppearance>>;

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Setter for [`compactAppearance`][Self::compactAppearance].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCompactAppearance:))]
        #[unsafe(method_family = none)]
        pub fn setCompactAppearance(&self, compact_appearance: Option<&UINavigationBarAppearance>);

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Describes the appearance attributes for the navigation bar to use when an associated UIScrollView has reached the edge abutting the bar (the top edge for the navigation bar). If not set, a modified standardAppearance will be used instead.
        #[unsafe(method(scrollEdgeAppearance))]
        #[unsafe(method_family = none)]
        pub fn scrollEdgeAppearance(&self) -> Option<Retained<UINavigationBarAppearance>>;

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Setter for [`scrollEdgeAppearance`][Self::scrollEdgeAppearance].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setScrollEdgeAppearance:))]
        #[unsafe(method_family = none)]
        pub fn setScrollEdgeAppearance(
            &self,
            scroll_edge_appearance: Option<&UINavigationBarAppearance>,
        );

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Describes the appearance attributes for the navigation bar to use when it is displayed with its compact heights, and an associated UIScrollView has reached the edge abutting the bar. If not set, first the scrollEdgeAppearance will be tried, and if that is nil then compactAppearance followed by a modified standardAppearance.
        #[unsafe(method(compactScrollEdgeAppearance))]
        #[unsafe(method_family = none)]
        pub fn compactScrollEdgeAppearance(&self) -> Option<Retained<UINavigationBarAppearance>>;

        #[cfg(all(feature = "UIBarAppearance", feature = "UINavigationBarAppearance"))]
        /// Setter for [`compactScrollEdgeAppearance`][Self::compactScrollEdgeAppearance].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCompactScrollEdgeAppearance:))]
        #[unsafe(method_family = none)]
        pub fn setCompactScrollEdgeAppearance(
            &self,
            compact_scroll_edge_appearance: Option<&UINavigationBarAppearance>,
        );
    );
}

/// Methods declared on superclass `UIView`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UINavigationBar {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

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

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UINavigationBar {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uinavigationbardelegate?language=objc)
    #[cfg(feature = "UIBarCommon")]
    pub unsafe trait UINavigationBarDelegate:
        UIBarPositioningDelegate + MainThreadOnly
    {
        #[cfg(all(
            feature = "UINavigationItem",
            feature = "UIResponder",
            feature = "UIView"
        ))]
        #[optional]
        #[unsafe(method(navigationBar:shouldPushItem:))]
        #[unsafe(method_family = none)]
        fn navigationBar_shouldPushItem(
            &self,
            navigation_bar: &UINavigationBar,
            item: &UINavigationItem,
        ) -> bool;

        #[cfg(all(
            feature = "UINavigationItem",
            feature = "UIResponder",
            feature = "UIView"
        ))]
        #[optional]
        #[unsafe(method(navigationBar:didPushItem:))]
        #[unsafe(method_family = none)]
        fn navigationBar_didPushItem(
            &self,
            navigation_bar: &UINavigationBar,
            item: &UINavigationItem,
        );

        #[cfg(all(
            feature = "UINavigationItem",
            feature = "UIResponder",
            feature = "UIView"
        ))]
        #[optional]
        #[unsafe(method(navigationBar:shouldPopItem:))]
        #[unsafe(method_family = none)]
        fn navigationBar_shouldPopItem(
            &self,
            navigation_bar: &UINavigationBar,
            item: &UINavigationItem,
        ) -> bool;

        #[cfg(all(
            feature = "UINavigationItem",
            feature = "UIResponder",
            feature = "UIView"
        ))]
        #[optional]
        #[unsafe(method(navigationBar:didPopItem:))]
        #[unsafe(method_family = none)]
        fn navigationBar_didPopItem(
            &self,
            navigation_bar: &UINavigationBar,
            item: &UINavigationItem,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        /// Which section of the NSToolbar this navigation bar should use when attempting to host in an NSToolbar. Returning 'None' will disable NSToolbar hosting as if preferredBehavioralStyle were set to 'Pad' The specific section returned will also affect how the navigation bar presents in that section.
        #[optional]
        #[unsafe(method(navigationBarNSToolbarSection:))]
        #[unsafe(method_family = none)]
        fn navigationBarNSToolbarSection(
            &self,
            navigation_bar: &UINavigationBar,
        ) -> UINavigationBarNSToolbarSection;
    }
);