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
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonType(pub NSInteger);
impl UIButtonType {
    #[doc(alias = "UIButtonTypeCustom")]
    pub const Custom: Self = Self(0);
    #[doc(alias = "UIButtonTypeSystem")]
    pub const System: Self = Self(1);
    #[doc(alias = "UIButtonTypeDetailDisclosure")]
    pub const DetailDisclosure: Self = Self(2);
    #[doc(alias = "UIButtonTypeInfoLight")]
    pub const InfoLight: Self = Self(3);
    #[doc(alias = "UIButtonTypeInfoDark")]
    pub const InfoDark: Self = Self(4);
    #[doc(alias = "UIButtonTypeContactAdd")]
    pub const ContactAdd: Self = Self(5);
    #[doc(alias = "UIButtonTypePlain")]
    pub const Plain: Self = Self(6);
    #[doc(alias = "UIButtonTypeClose")]
    pub const Close: Self = Self(7);
    #[doc(alias = "UIButtonTypeRoundedRect")]
    pub const RoundedRect: Self = Self(UIButtonType::System.0);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonRole(pub NSInteger);
impl UIButtonRole {
    #[doc(alias = "UIButtonRoleNormal")]
    pub const Normal: Self = Self(0);
    #[doc(alias = "UIButtonRolePrimary")]
    pub const Primary: Self = Self(1);
    #[doc(alias = "UIButtonRoleCancel")]
    pub const Cancel: Self = Self(2);
    #[doc(alias = "UIButtonRoleDestructive")]
    pub const Destructive: Self = Self(3);
}

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

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

#[cfg(all(
    feature = "UIControl",
    feature = "UIHoverStyle",
    feature = "UIPointerStyle",
    feature = "UIResponder",
    feature = "UIView",
    feature = "block2"
))]
pub type UIButtonPointerStyleProvider = *mut block2::Block<
    dyn Fn(
        NonNull<UIButton>,
        NonNull<UIPointerEffect>,
        NonNull<UIPointerShape>,
    ) -> *mut UIPointerStyle,
>;

#[cfg(all(
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView",
    feature = "block2"
))]
pub type UIButtonConfigurationUpdateHandler = *mut block2::Block<dyn Fn(NonNull<UIButton>)>;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    pub struct UIButton;

    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    unsafe impl ClassType for UIButton {
        #[inherits(UIView, UIResponder, NSObject)]
        type Super = UIControl;
        type Mutability = MainThreadOnly;
    }
);

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

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UIButton {}

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UIButton {}

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView"
))]
unsafe impl UIAppearance for UIButton {}

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView"
))]
unsafe impl UIAppearanceContainer for UIButton {}

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UIButton {}

#[cfg(all(
    feature = "UIControl",
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
unsafe impl UIDynamicItem for UIButton {}

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
unsafe impl UIFocusEnvironment for UIButton {}

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
unsafe impl UIFocusItem for UIButton {}

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
unsafe impl UIFocusItemContainer for UIButton {}

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UIButton {}

#[cfg(all(
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIView"
))]
unsafe impl UITraitEnvironment for UIButton {}

extern_methods!(
    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    unsafe impl UIButton {
        #[method_id(@__retain_semantics Init initWithFrame:)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
        #[method_id(@__retain_semantics Init initWithFrame:primaryAction:)]
        pub unsafe fn initWithFrame_primaryAction(
            this: Allocated<Self>,
            frame: CGRect,
            primary_action: Option<&UIAction>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Other buttonWithType:)]
        pub unsafe fn buttonWithType(
            button_type: UIButtonType,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other systemButtonWithImage:target:action:)]
        pub unsafe fn systemButtonWithImage_target_action(
            image: &UIImage,
            target: Option<&AnyObject>,
            action: Option<Sel>,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
        #[method_id(@__retain_semantics Other systemButtonWithPrimaryAction:)]
        pub unsafe fn systemButtonWithPrimaryAction(
            primary_action: Option<&UIAction>,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
        #[method_id(@__retain_semantics Other buttonWithType:primaryAction:)]
        pub unsafe fn buttonWithType_primaryAction(
            button_type: UIButtonType,
            primary_action: Option<&UIAction>,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "UIAction",
            feature = "UIButtonConfiguration",
            feature = "UIMenuElement"
        ))]
        #[method_id(@__retain_semantics Other buttonWithConfiguration:primaryAction:)]
        pub unsafe fn buttonWithConfiguration_primaryAction(
            configuration: &UIButtonConfiguration,
            primary_action: Option<&UIAction>,
        ) -> Retained<Self>;

        #[cfg(feature = "UIButtonConfiguration")]
        #[method_id(@__retain_semantics Other configuration)]
        pub unsafe fn configuration(&self) -> Option<Retained<UIButtonConfiguration>>;

        #[cfg(feature = "UIButtonConfiguration")]
        #[method(setConfiguration:)]
        pub unsafe fn setConfiguration(&self, configuration: Option<&UIButtonConfiguration>);

        #[method(setNeedsUpdateConfiguration)]
        pub unsafe fn setNeedsUpdateConfiguration(&self);

        #[method(updateConfiguration)]
        pub unsafe fn updateConfiguration(&self);

        #[cfg(feature = "block2")]
        #[method(configurationUpdateHandler)]
        pub unsafe fn configurationUpdateHandler(&self) -> UIButtonConfigurationUpdateHandler;

        #[cfg(feature = "block2")]
        #[method(setConfigurationUpdateHandler:)]
        pub unsafe fn setConfigurationUpdateHandler(
            &self,
            configuration_update_handler: UIButtonConfigurationUpdateHandler,
        );

        #[method(automaticallyUpdatesConfiguration)]
        pub unsafe fn automaticallyUpdatesConfiguration(&self) -> bool;

        #[method(setAutomaticallyUpdatesConfiguration:)]
        pub unsafe fn setAutomaticallyUpdatesConfiguration(
            &self,
            automatically_updates_configuration: bool,
        );

        #[cfg(feature = "UIColor")]
        #[method_id(@__retain_semantics Other tintColor)]
        pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        #[method(setTintColor:)]
        pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);

        #[method(buttonType)]
        pub unsafe fn buttonType(&self) -> UIButtonType;

        #[method(isHovered)]
        pub unsafe fn isHovered(&self) -> bool;

        #[method(isHeld)]
        pub unsafe fn isHeld(&self) -> bool;

        #[method(role)]
        pub unsafe fn role(&self) -> UIButtonRole;

        #[method(setRole:)]
        pub unsafe fn setRole(&self, role: UIButtonRole);

        #[method(isPointerInteractionEnabled)]
        pub unsafe fn isPointerInteractionEnabled(&self) -> bool;

        #[method(setPointerInteractionEnabled:)]
        pub unsafe fn setPointerInteractionEnabled(&self, pointer_interaction_enabled: bool);

        #[cfg(all(
            feature = "UIHoverStyle",
            feature = "UIPointerStyle",
            feature = "block2"
        ))]
        #[method(pointerStyleProvider)]
        pub unsafe fn pointerStyleProvider(&self) -> UIButtonPointerStyleProvider;

        #[cfg(all(
            feature = "UIHoverStyle",
            feature = "UIPointerStyle",
            feature = "block2"
        ))]
        #[method(setPointerStyleProvider:)]
        pub unsafe fn setPointerStyleProvider(
            &self,
            pointer_style_provider: UIButtonPointerStyleProvider,
        );

        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
        #[method_id(@__retain_semantics Other menu)]
        pub unsafe fn menu(&self) -> Option<Retained<UIMenu>>;

        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
        #[method(setMenu:)]
        pub unsafe fn setMenu(&self, menu: Option<&UIMenu>);

        #[cfg(feature = "UIContextMenuConfiguration")]
        #[method(preferredMenuElementOrder)]
        pub unsafe fn preferredMenuElementOrder(&self) -> UIContextMenuConfigurationElementOrder;

        #[cfg(feature = "UIContextMenuConfiguration")]
        #[method(setPreferredMenuElementOrder:)]
        pub unsafe fn setPreferredMenuElementOrder(
            &self,
            preferred_menu_element_order: UIContextMenuConfigurationElementOrder,
        );

        #[method(changesSelectionAsPrimaryAction)]
        pub unsafe fn changesSelectionAsPrimaryAction(&self) -> bool;

        #[method(setChangesSelectionAsPrimaryAction:)]
        pub unsafe fn setChangesSelectionAsPrimaryAction(
            &self,
            changes_selection_as_primary_action: bool,
        );

        #[method(setTitle:forState:)]
        pub unsafe fn setTitle_forState(&self, title: Option<&NSString>, state: UIControlState);

        #[cfg(feature = "UIColor")]
        #[method(setTitleColor:forState:)]
        pub unsafe fn setTitleColor_forState(&self, color: Option<&UIColor>, state: UIControlState);

        #[cfg(feature = "UIColor")]
        #[method(setTitleShadowColor:forState:)]
        pub unsafe fn setTitleShadowColor_forState(
            &self,
            color: Option<&UIColor>,
            state: UIControlState,
        );

        #[cfg(feature = "UIImage")]
        #[method(setImage:forState:)]
        pub unsafe fn setImage_forState(&self, image: Option<&UIImage>, state: UIControlState);

        #[cfg(feature = "UIImage")]
        #[method(setBackgroundImage:forState:)]
        pub unsafe fn setBackgroundImage_forState(
            &self,
            image: Option<&UIImage>,
            state: UIControlState,
        );

        #[cfg(all(
            feature = "UIImageConfiguration",
            feature = "UIImageSymbolConfiguration"
        ))]
        #[method(setPreferredSymbolConfiguration:forImageInState:)]
        pub unsafe fn setPreferredSymbolConfiguration_forImageInState(
            &self,
            configuration: Option<&UIImageSymbolConfiguration>,
            state: UIControlState,
        );

        #[method(setAttributedTitle:forState:)]
        pub unsafe fn setAttributedTitle_forState(
            &self,
            title: Option<&NSAttributedString>,
            state: UIControlState,
        );

        #[method_id(@__retain_semantics Other titleForState:)]
        pub unsafe fn titleForState(&self, state: UIControlState) -> Option<Retained<NSString>>;

        #[cfg(feature = "UIColor")]
        #[method_id(@__retain_semantics Other titleColorForState:)]
        pub unsafe fn titleColorForState(&self, state: UIControlState)
            -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        #[method_id(@__retain_semantics Other titleShadowColorForState:)]
        pub unsafe fn titleShadowColorForState(
            &self,
            state: UIControlState,
        ) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other imageForState:)]
        pub unsafe fn imageForState(&self, state: UIControlState) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other backgroundImageForState:)]
        pub unsafe fn backgroundImageForState(
            &self,
            state: UIControlState,
        ) -> Option<Retained<UIImage>>;

        #[cfg(all(
            feature = "UIImageConfiguration",
            feature = "UIImageSymbolConfiguration"
        ))]
        #[method_id(@__retain_semantics Other preferredSymbolConfigurationForImageInState:)]
        pub unsafe fn preferredSymbolConfigurationForImageInState(
            &self,
            state: UIControlState,
        ) -> Option<Retained<UIImageSymbolConfiguration>>;

        #[method_id(@__retain_semantics Other attributedTitleForState:)]
        pub unsafe fn attributedTitleForState(
            &self,
            state: UIControlState,
        ) -> Option<Retained<NSAttributedString>>;

        #[method_id(@__retain_semantics Other currentTitle)]
        pub unsafe fn currentTitle(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "UIColor")]
        #[method_id(@__retain_semantics Other currentTitleColor)]
        pub unsafe fn currentTitleColor(&self) -> Retained<UIColor>;

        #[cfg(feature = "UIColor")]
        #[method_id(@__retain_semantics Other currentTitleShadowColor)]
        pub unsafe fn currentTitleShadowColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other currentImage)]
        pub unsafe fn currentImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other currentBackgroundImage)]
        pub unsafe fn currentBackgroundImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(all(
            feature = "UIImageConfiguration",
            feature = "UIImageSymbolConfiguration"
        ))]
        #[method_id(@__retain_semantics Other currentPreferredSymbolConfiguration)]
        pub unsafe fn currentPreferredSymbolConfiguration(
            &self,
        ) -> Option<Retained<UIImageSymbolConfiguration>>;

        #[method_id(@__retain_semantics Other currentAttributedTitle)]
        pub unsafe fn currentAttributedTitle(&self) -> Option<Retained<NSAttributedString>>;

        #[cfg(feature = "UILabel")]
        #[method_id(@__retain_semantics Other titleLabel)]
        pub unsafe fn titleLabel(&self) -> Option<Retained<UILabel>>;

        #[cfg(feature = "UIImageView")]
        #[method_id(@__retain_semantics Other imageView)]
        pub unsafe fn imageView(&self) -> Option<Retained<UIImageView>>;

        #[cfg(feature = "UILabel")]
        #[method_id(@__retain_semantics Other subtitleLabel)]
        pub unsafe fn subtitleLabel(&self) -> Option<Retained<UILabel>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    unsafe impl UIButton {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);

extern_methods!(
    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    unsafe impl UIButton {
        #[cfg(feature = "UIFont")]
        #[deprecated = "Specify an attributed title with a custom font"]
        #[method_id(@__retain_semantics Other font)]
        pub unsafe fn font(&self) -> Retained<UIFont>;

        #[cfg(feature = "UIFont")]
        #[deprecated = "Specify an attributed title with a custom font"]
        #[method(setFont:)]
        pub unsafe fn setFont(&self, font: &UIFont);

        #[cfg(feature = "NSParagraphStyle")]
        #[deprecated = "Specify an attributed title with a customized paragraph style"]
        #[method(lineBreakMode)]
        pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;

        #[cfg(feature = "NSParagraphStyle")]
        #[deprecated = "Specify an attributed title with a customized paragraph style"]
        #[method(setLineBreakMode:)]
        pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);

        #[deprecated = "Specify an attributed title with a customized shadow style"]
        #[method(titleShadowOffset)]
        pub unsafe fn titleShadowOffset(&self) -> CGSize;

        #[deprecated = "Specify an attributed title with a customized shadow style"]
        #[method(setTitleShadowOffset:)]
        pub unsafe fn setTitleShadowOffset(&self, title_shadow_offset: CGSize);

        #[cfg(feature = "UIGeometry")]
        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(contentEdgeInsets)]
        pub unsafe fn contentEdgeInsets(&self) -> UIEdgeInsets;

        #[cfg(feature = "UIGeometry")]
        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(setContentEdgeInsets:)]
        pub unsafe fn setContentEdgeInsets(&self, content_edge_insets: UIEdgeInsets);

        #[cfg(feature = "UIGeometry")]
        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(titleEdgeInsets)]
        pub unsafe fn titleEdgeInsets(&self) -> UIEdgeInsets;

        #[cfg(feature = "UIGeometry")]
        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(setTitleEdgeInsets:)]
        pub unsafe fn setTitleEdgeInsets(&self, title_edge_insets: UIEdgeInsets);

        #[cfg(feature = "UIGeometry")]
        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(imageEdgeInsets)]
        pub unsafe fn imageEdgeInsets(&self) -> UIEdgeInsets;

        #[cfg(feature = "UIGeometry")]
        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(setImageEdgeInsets:)]
        pub unsafe fn setImageEdgeInsets(&self, image_edge_insets: UIEdgeInsets);

        #[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
        #[method(reversesTitleShadowWhenHighlighted)]
        pub unsafe fn reversesTitleShadowWhenHighlighted(&self) -> bool;

        #[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
        #[method(setReversesTitleShadowWhenHighlighted:)]
        pub unsafe fn setReversesTitleShadowWhenHighlighted(
            &self,
            reverses_title_shadow_when_highlighted: bool,
        );

        #[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
        #[method(adjustsImageWhenHighlighted)]
        pub unsafe fn adjustsImageWhenHighlighted(&self) -> bool;

        #[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
        #[method(setAdjustsImageWhenHighlighted:)]
        pub unsafe fn setAdjustsImageWhenHighlighted(&self, adjusts_image_when_highlighted: bool);

        #[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
        #[method(adjustsImageWhenDisabled)]
        pub unsafe fn adjustsImageWhenDisabled(&self) -> bool;

        #[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
        #[method(setAdjustsImageWhenDisabled:)]
        pub unsafe fn setAdjustsImageWhenDisabled(&self, adjusts_image_when_disabled: bool);

        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(showsTouchWhenHighlighted)]
        pub unsafe fn showsTouchWhenHighlighted(&self) -> bool;

        #[deprecated = "This property is ignored when using UIButtonConfiguration"]
        #[method(setShowsTouchWhenHighlighted:)]
        pub unsafe fn setShowsTouchWhenHighlighted(&self, shows_touch_when_highlighted: bool);

        #[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
        #[method(backgroundRectForBounds:)]
        pub unsafe fn backgroundRectForBounds(&self, bounds: CGRect) -> CGRect;

        #[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
        #[method(contentRectForBounds:)]
        pub unsafe fn contentRectForBounds(&self, bounds: CGRect) -> CGRect;

        #[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
        #[method(titleRectForContentRect:)]
        pub unsafe fn titleRectForContentRect(&self, content_rect: CGRect) -> CGRect;

        #[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
        #[method(imageRectForContentRect:)]
        pub unsafe fn imageRectForContentRect(&self, content_rect: CGRect) -> CGRect;
    }
);

extern_methods!(
    /// SpringLoading
    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    unsafe impl UIButton {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UISpringLoadedInteractionSupporting",
    feature = "UIView"
))]
unsafe impl UISpringLoadedInteractionSupporting for UIButton {}