objc2_ui_kit/generated/
UIView.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewanimationcurve?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UIViewAnimationCurve(pub NSInteger);
20impl UIViewAnimationCurve {
21    #[doc(alias = "UIViewAnimationCurveEaseInOut")]
22    pub const EaseInOut: Self = Self(0);
23    #[doc(alias = "UIViewAnimationCurveEaseIn")]
24    pub const EaseIn: Self = Self(1);
25    #[doc(alias = "UIViewAnimationCurveEaseOut")]
26    pub const EaseOut: Self = Self(2);
27    #[doc(alias = "UIViewAnimationCurveLinear")]
28    pub const Linear: Self = Self(3);
29}
30
31unsafe impl Encode for UIViewAnimationCurve {
32    const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for UIViewAnimationCurve {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewcontentmode?language=objc)
40// NS_ENUM
41#[repr(transparent)]
42#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
43pub struct UIViewContentMode(pub NSInteger);
44impl UIViewContentMode {
45    #[doc(alias = "UIViewContentModeScaleToFill")]
46    pub const ScaleToFill: Self = Self(0);
47    #[doc(alias = "UIViewContentModeScaleAspectFit")]
48    pub const ScaleAspectFit: Self = Self(1);
49    #[doc(alias = "UIViewContentModeScaleAspectFill")]
50    pub const ScaleAspectFill: Self = Self(2);
51    #[doc(alias = "UIViewContentModeRedraw")]
52    pub const Redraw: Self = Self(3);
53    #[doc(alias = "UIViewContentModeCenter")]
54    pub const Center: Self = Self(4);
55    #[doc(alias = "UIViewContentModeTop")]
56    pub const Top: Self = Self(5);
57    #[doc(alias = "UIViewContentModeBottom")]
58    pub const Bottom: Self = Self(6);
59    #[doc(alias = "UIViewContentModeLeft")]
60    pub const Left: Self = Self(7);
61    #[doc(alias = "UIViewContentModeRight")]
62    pub const Right: Self = Self(8);
63    #[doc(alias = "UIViewContentModeTopLeft")]
64    pub const TopLeft: Self = Self(9);
65    #[doc(alias = "UIViewContentModeTopRight")]
66    pub const TopRight: Self = Self(10);
67    #[doc(alias = "UIViewContentModeBottomLeft")]
68    pub const BottomLeft: Self = Self(11);
69    #[doc(alias = "UIViewContentModeBottomRight")]
70    pub const BottomRight: Self = Self(12);
71}
72
73unsafe impl Encode for UIViewContentMode {
74    const ENCODING: Encoding = NSInteger::ENCODING;
75}
76
77unsafe impl RefEncode for UIViewContentMode {
78    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
79}
80
81/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewanimationtransition?language=objc)
82// NS_ENUM
83#[repr(transparent)]
84#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
85pub struct UIViewAnimationTransition(pub NSInteger);
86impl UIViewAnimationTransition {
87    #[doc(alias = "UIViewAnimationTransitionNone")]
88    pub const None: Self = Self(0);
89    #[doc(alias = "UIViewAnimationTransitionFlipFromLeft")]
90    pub const FlipFromLeft: Self = Self(1);
91    #[doc(alias = "UIViewAnimationTransitionFlipFromRight")]
92    pub const FlipFromRight: Self = Self(2);
93    #[doc(alias = "UIViewAnimationTransitionCurlUp")]
94    pub const CurlUp: Self = Self(3);
95    #[doc(alias = "UIViewAnimationTransitionCurlDown")]
96    pub const CurlDown: Self = Self(4);
97}
98
99unsafe impl Encode for UIViewAnimationTransition {
100    const ENCODING: Encoding = NSInteger::ENCODING;
101}
102
103unsafe impl RefEncode for UIViewAnimationTransition {
104    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
105}
106
107/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewautoresizing?language=objc)
108// NS_OPTIONS
109#[repr(transparent)]
110#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
111pub struct UIViewAutoresizing(pub NSUInteger);
112bitflags::bitflags! {
113    impl UIViewAutoresizing: NSUInteger {
114        #[doc(alias = "UIViewAutoresizingNone")]
115        const None = 0;
116        #[doc(alias = "UIViewAutoresizingFlexibleLeftMargin")]
117        const FlexibleLeftMargin = 1<<0;
118        #[doc(alias = "UIViewAutoresizingFlexibleWidth")]
119        const FlexibleWidth = 1<<1;
120        #[doc(alias = "UIViewAutoresizingFlexibleRightMargin")]
121        const FlexibleRightMargin = 1<<2;
122        #[doc(alias = "UIViewAutoresizingFlexibleTopMargin")]
123        const FlexibleTopMargin = 1<<3;
124        #[doc(alias = "UIViewAutoresizingFlexibleHeight")]
125        const FlexibleHeight = 1<<4;
126        #[doc(alias = "UIViewAutoresizingFlexibleBottomMargin")]
127        const FlexibleBottomMargin = 1<<5;
128    }
129}
130
131unsafe impl Encode for UIViewAutoresizing {
132    const ENCODING: Encoding = NSUInteger::ENCODING;
133}
134
135unsafe impl RefEncode for UIViewAutoresizing {
136    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
137}
138
139/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewanimationoptions?language=objc)
140// NS_OPTIONS
141#[repr(transparent)]
142#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
143pub struct UIViewAnimationOptions(pub NSUInteger);
144bitflags::bitflags! {
145    impl UIViewAnimationOptions: NSUInteger {
146        #[doc(alias = "UIViewAnimationOptionLayoutSubviews")]
147        const LayoutSubviews = 1<<0;
148        #[doc(alias = "UIViewAnimationOptionAllowUserInteraction")]
149        const AllowUserInteraction = 1<<1;
150        #[doc(alias = "UIViewAnimationOptionBeginFromCurrentState")]
151        const BeginFromCurrentState = 1<<2;
152        #[doc(alias = "UIViewAnimationOptionRepeat")]
153        const Repeat = 1<<3;
154        #[doc(alias = "UIViewAnimationOptionAutoreverse")]
155        const Autoreverse = 1<<4;
156        #[doc(alias = "UIViewAnimationOptionOverrideInheritedDuration")]
157        const OverrideInheritedDuration = 1<<5;
158        #[doc(alias = "UIViewAnimationOptionOverrideInheritedCurve")]
159        const OverrideInheritedCurve = 1<<6;
160        #[doc(alias = "UIViewAnimationOptionAllowAnimatedContent")]
161        const AllowAnimatedContent = 1<<7;
162        #[doc(alias = "UIViewAnimationOptionShowHideTransitionViews")]
163        const ShowHideTransitionViews = 1<<8;
164        #[doc(alias = "UIViewAnimationOptionOverrideInheritedOptions")]
165        const OverrideInheritedOptions = 1<<9;
166        #[doc(alias = "UIViewAnimationOptionCurveEaseInOut")]
167        const CurveEaseInOut = 0<<16;
168        #[doc(alias = "UIViewAnimationOptionCurveEaseIn")]
169        const CurveEaseIn = 1<<16;
170        #[doc(alias = "UIViewAnimationOptionCurveEaseOut")]
171        const CurveEaseOut = 2<<16;
172        #[doc(alias = "UIViewAnimationOptionCurveLinear")]
173        const CurveLinear = 3<<16;
174        #[doc(alias = "UIViewAnimationOptionTransitionNone")]
175        const TransitionNone = 0<<20;
176        #[doc(alias = "UIViewAnimationOptionTransitionFlipFromLeft")]
177        const TransitionFlipFromLeft = 1<<20;
178        #[doc(alias = "UIViewAnimationOptionTransitionFlipFromRight")]
179        const TransitionFlipFromRight = 2<<20;
180        #[doc(alias = "UIViewAnimationOptionTransitionCurlUp")]
181        const TransitionCurlUp = 3<<20;
182        #[doc(alias = "UIViewAnimationOptionTransitionCurlDown")]
183        const TransitionCurlDown = 4<<20;
184        #[doc(alias = "UIViewAnimationOptionTransitionCrossDissolve")]
185        const TransitionCrossDissolve = 5<<20;
186        #[doc(alias = "UIViewAnimationOptionTransitionFlipFromTop")]
187        const TransitionFlipFromTop = 6<<20;
188        #[doc(alias = "UIViewAnimationOptionTransitionFlipFromBottom")]
189        const TransitionFlipFromBottom = 7<<20;
190        #[doc(alias = "UIViewAnimationOptionPreferredFramesPerSecondDefault")]
191        const PreferredFramesPerSecondDefault = 0<<24;
192        #[doc(alias = "UIViewAnimationOptionPreferredFramesPerSecond60")]
193        const PreferredFramesPerSecond60 = 3<<24;
194        #[doc(alias = "UIViewAnimationOptionPreferredFramesPerSecond30")]
195        const PreferredFramesPerSecond30 = 7<<24;
196    }
197}
198
199unsafe impl Encode for UIViewAnimationOptions {
200    const ENCODING: Encoding = NSUInteger::ENCODING;
201}
202
203unsafe impl RefEncode for UIViewAnimationOptions {
204    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
205}
206
207/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewkeyframeanimationoptions?language=objc)
208// NS_OPTIONS
209#[repr(transparent)]
210#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
211pub struct UIViewKeyframeAnimationOptions(pub NSUInteger);
212bitflags::bitflags! {
213    impl UIViewKeyframeAnimationOptions: NSUInteger {
214        #[doc(alias = "UIViewKeyframeAnimationOptionLayoutSubviews")]
215        const LayoutSubviews = UIViewAnimationOptions::LayoutSubviews.0;
216        #[doc(alias = "UIViewKeyframeAnimationOptionAllowUserInteraction")]
217        const AllowUserInteraction = UIViewAnimationOptions::AllowUserInteraction.0;
218        #[doc(alias = "UIViewKeyframeAnimationOptionBeginFromCurrentState")]
219        const BeginFromCurrentState = UIViewAnimationOptions::BeginFromCurrentState.0;
220        #[doc(alias = "UIViewKeyframeAnimationOptionRepeat")]
221        const Repeat = UIViewAnimationOptions::Repeat.0;
222        #[doc(alias = "UIViewKeyframeAnimationOptionAutoreverse")]
223        const Autoreverse = UIViewAnimationOptions::Autoreverse.0;
224        #[doc(alias = "UIViewKeyframeAnimationOptionOverrideInheritedDuration")]
225        const OverrideInheritedDuration = UIViewAnimationOptions::OverrideInheritedDuration.0;
226        #[doc(alias = "UIViewKeyframeAnimationOptionOverrideInheritedOptions")]
227        const OverrideInheritedOptions = UIViewAnimationOptions::OverrideInheritedOptions.0;
228        #[doc(alias = "UIViewKeyframeAnimationOptionCalculationModeLinear")]
229        const CalculationModeLinear = 0<<10;
230        #[doc(alias = "UIViewKeyframeAnimationOptionCalculationModeDiscrete")]
231        const CalculationModeDiscrete = 1<<10;
232        #[doc(alias = "UIViewKeyframeAnimationOptionCalculationModePaced")]
233        const CalculationModePaced = 2<<10;
234        #[doc(alias = "UIViewKeyframeAnimationOptionCalculationModeCubic")]
235        const CalculationModeCubic = 3<<10;
236        #[doc(alias = "UIViewKeyframeAnimationOptionCalculationModeCubicPaced")]
237        const CalculationModeCubicPaced = 4<<10;
238    }
239}
240
241unsafe impl Encode for UIViewKeyframeAnimationOptions {
242    const ENCODING: Encoding = NSUInteger::ENCODING;
243}
244
245unsafe impl RefEncode for UIViewKeyframeAnimationOptions {
246    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
247}
248
249/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisystemanimation?language=objc)
250// NS_ENUM
251#[repr(transparent)]
252#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
253pub struct UISystemAnimation(pub NSUInteger);
254impl UISystemAnimation {
255    #[doc(alias = "UISystemAnimationDelete")]
256    pub const Delete: Self = Self(0);
257}
258
259unsafe impl Encode for UISystemAnimation {
260    const ENCODING: Encoding = NSUInteger::ENCODING;
261}
262
263unsafe impl RefEncode for UISystemAnimation {
264    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
265}
266
267/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewtintadjustmentmode?language=objc)
268// NS_ENUM
269#[repr(transparent)]
270#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
271pub struct UIViewTintAdjustmentMode(pub NSInteger);
272impl UIViewTintAdjustmentMode {
273    #[doc(alias = "UIViewTintAdjustmentModeAutomatic")]
274    pub const Automatic: Self = Self(0);
275    #[doc(alias = "UIViewTintAdjustmentModeNormal")]
276    pub const Normal: Self = Self(1);
277    #[doc(alias = "UIViewTintAdjustmentModeDimmed")]
278    pub const Dimmed: Self = Self(2);
279}
280
281unsafe impl Encode for UIViewTintAdjustmentMode {
282    const ENCODING: Encoding = NSInteger::ENCODING;
283}
284
285unsafe impl RefEncode for UIViewTintAdjustmentMode {
286    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
287}
288
289/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisemanticcontentattribute?language=objc)
290// NS_ENUM
291#[repr(transparent)]
292#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
293pub struct UISemanticContentAttribute(pub NSInteger);
294impl UISemanticContentAttribute {
295    #[doc(alias = "UISemanticContentAttributeUnspecified")]
296    pub const Unspecified: Self = Self(0);
297    #[doc(alias = "UISemanticContentAttributePlayback")]
298    pub const Playback: Self = Self(1);
299    #[doc(alias = "UISemanticContentAttributeSpatial")]
300    pub const Spatial: Self = Self(2);
301    #[doc(alias = "UISemanticContentAttributeForceLeftToRight")]
302    pub const ForceLeftToRight: Self = Self(3);
303    #[doc(alias = "UISemanticContentAttributeForceRightToLeft")]
304    pub const ForceRightToLeft: Self = Self(4);
305}
306
307unsafe impl Encode for UISemanticContentAttribute {
308    const ENCODING: Encoding = NSInteger::ENCODING;
309}
310
311unsafe impl RefEncode for UISemanticContentAttribute {
312    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
313}
314
315extern_protocol!(
316    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicoordinatespace?language=objc)
317    pub unsafe trait UICoordinateSpace: NSObjectProtocol + MainThreadOnly {
318        #[cfg(feature = "objc2-core-foundation")]
319        #[unsafe(method(convertPoint:toCoordinateSpace:))]
320        #[unsafe(method_family = none)]
321        fn convertPoint_toCoordinateSpace(
322            &self,
323            point: CGPoint,
324            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
325        ) -> CGPoint;
326
327        #[cfg(feature = "objc2-core-foundation")]
328        #[unsafe(method(convertPoint:fromCoordinateSpace:))]
329        #[unsafe(method_family = none)]
330        fn convertPoint_fromCoordinateSpace(
331            &self,
332            point: CGPoint,
333            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
334        ) -> CGPoint;
335
336        #[cfg(feature = "objc2-core-foundation")]
337        #[unsafe(method(convertRect:toCoordinateSpace:))]
338        #[unsafe(method_family = none)]
339        fn convertRect_toCoordinateSpace(
340            &self,
341            rect: CGRect,
342            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
343        ) -> CGRect;
344
345        #[cfg(feature = "objc2-core-foundation")]
346        #[unsafe(method(convertRect:fromCoordinateSpace:))]
347        #[unsafe(method_family = none)]
348        fn convertRect_fromCoordinateSpace(
349            &self,
350            rect: CGRect,
351            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
352        ) -> CGRect;
353
354        #[cfg(feature = "objc2-core-foundation")]
355        #[unsafe(method(bounds))]
356        #[unsafe(method_family = none)]
357        fn bounds(&self) -> CGRect;
358    }
359);
360
361extern_class!(
362    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiview?language=objc)
363    #[unsafe(super(UIResponder, NSObject))]
364    #[thread_kind = MainThreadOnly]
365    #[derive(Debug, PartialEq, Eq, Hash)]
366    #[cfg(feature = "UIResponder")]
367    pub struct UIView;
368);
369
370#[cfg(all(feature = "UIResponder", feature = "objc2-quartz-core"))]
371#[cfg(not(target_os = "watchos"))]
372extern_conformance!(
373    unsafe impl CALayerDelegate for UIView {}
374);
375
376#[cfg(feature = "UIResponder")]
377extern_conformance!(
378    unsafe impl NSCoding for UIView {}
379);
380
381#[cfg(feature = "UIResponder")]
382extern_conformance!(
383    unsafe impl NSObjectProtocol for UIView {}
384);
385
386#[cfg(all(feature = "UIAppearance", feature = "UIResponder"))]
387extern_conformance!(
388    unsafe impl UIAppearance for UIView {}
389);
390
391#[cfg(all(feature = "UIAppearance", feature = "UIResponder"))]
392extern_conformance!(
393    unsafe impl UIAppearanceContainer for UIView {}
394);
395
396#[cfg(feature = "UIResponder")]
397extern_conformance!(
398    unsafe impl UICoordinateSpace for UIView {}
399);
400
401#[cfg(all(feature = "UIDynamicBehavior", feature = "UIResponder"))]
402extern_conformance!(
403    unsafe impl UIDynamicItem for UIView {}
404);
405
406#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
407extern_conformance!(
408    unsafe impl UIFocusEnvironment for UIView {}
409);
410
411#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
412extern_conformance!(
413    unsafe impl UIFocusItem for UIView {}
414);
415
416#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
417extern_conformance!(
418    unsafe impl UIFocusItemContainer for UIView {}
419);
420
421#[cfg(feature = "UIResponder")]
422extern_conformance!(
423    unsafe impl UIResponderStandardEditActions for UIView {}
424);
425
426#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
427extern_conformance!(
428    unsafe impl UITraitEnvironment for UIView {}
429);
430
431#[cfg(feature = "UIResponder")]
432impl UIView {
433    extern_methods!(
434        #[unsafe(method(layerClass))]
435        #[unsafe(method_family = none)]
436        pub fn layerClass(mtm: MainThreadMarker) -> &'static AnyClass;
437
438        #[cfg(feature = "objc2-core-foundation")]
439        #[unsafe(method(initWithFrame:))]
440        #[unsafe(method_family = init)]
441        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
442
443        #[unsafe(method(initWithCoder:))]
444        #[unsafe(method_family = init)]
445        pub unsafe fn initWithCoder(
446            this: Allocated<Self>,
447            coder: &NSCoder,
448        ) -> Option<Retained<Self>>;
449
450        #[unsafe(method(isUserInteractionEnabled))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn isUserInteractionEnabled(&self) -> bool;
453
454        /// Setter for [`isUserInteractionEnabled`][Self::isUserInteractionEnabled].
455        #[unsafe(method(setUserInteractionEnabled:))]
456        #[unsafe(method_family = none)]
457        pub unsafe fn setUserInteractionEnabled(&self, user_interaction_enabled: bool);
458
459        #[unsafe(method(tag))]
460        #[unsafe(method_family = none)]
461        pub unsafe fn tag(&self) -> NSInteger;
462
463        /// Setter for [`tag`][Self::tag].
464        #[unsafe(method(setTag:))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn setTag(&self, tag: NSInteger);
467
468        #[cfg(feature = "objc2-quartz-core")]
469        #[cfg(not(target_os = "watchos"))]
470        #[unsafe(method(layer))]
471        #[unsafe(method_family = none)]
472        pub fn layer(&self) -> Retained<CALayer>;
473
474        #[unsafe(method(canBecomeFocused))]
475        #[unsafe(method_family = none)]
476        pub unsafe fn canBecomeFocused(&self) -> bool;
477
478        #[unsafe(method(isFocused))]
479        #[unsafe(method_family = none)]
480        pub unsafe fn isFocused(&self) -> bool;
481
482        /// The identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview's focus group.
483        #[unsafe(method(focusGroupIdentifier))]
484        #[unsafe(method_family = none)]
485        pub unsafe fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>;
486
487        /// Setter for [`focusGroupIdentifier`][Self::focusGroupIdentifier].
488        #[unsafe(method(setFocusGroupIdentifier:))]
489        #[unsafe(method_family = none)]
490        pub unsafe fn setFocusGroupIdentifier(&self, focus_group_identifier: Option<&NSString>);
491
492        #[cfg(feature = "UIFocus")]
493        /// The priority this item has in its focus group. The higher the priority, the more likely it is to get picked when focus moves into this group.
494        /// Note: this method can only be used to increase an item's priority, not decrease it. For example if an item is currently selected, the actual priority of this item will be determined by MAX(focusGroupPriority, UIFocusGroupPrioritySelected).
495        #[unsafe(method(focusGroupPriority))]
496        #[unsafe(method_family = none)]
497        pub unsafe fn focusGroupPriority(&self) -> UIFocusGroupPriority;
498
499        #[cfg(feature = "UIFocus")]
500        /// Setter for [`focusGroupPriority`][Self::focusGroupPriority].
501        #[unsafe(method(setFocusGroupPriority:))]
502        #[unsafe(method_family = none)]
503        pub unsafe fn setFocusGroupPriority(&self, focus_group_priority: UIFocusGroupPriority);
504
505        #[cfg(feature = "UIFocusEffect")]
506        /// Describes a visual effect to apply when this item is focused. If this property is nil no effect will be applied when this view becomes focused.
507        #[unsafe(method(focusEffect))]
508        #[unsafe(method_family = none)]
509        pub unsafe fn focusEffect(&self) -> Option<Retained<UIFocusEffect>>;
510
511        #[cfg(feature = "UIFocusEffect")]
512        /// Setter for [`focusEffect`][Self::focusEffect].
513        #[unsafe(method(setFocusEffect:))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn setFocusEffect(&self, focus_effect: Option<&UIFocusEffect>);
516
517        #[unsafe(method(semanticContentAttribute))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn semanticContentAttribute(&self) -> UISemanticContentAttribute;
520
521        /// Setter for [`semanticContentAttribute`][Self::semanticContentAttribute].
522        #[unsafe(method(setSemanticContentAttribute:))]
523        #[unsafe(method_family = none)]
524        pub unsafe fn setSemanticContentAttribute(
525            &self,
526            semantic_content_attribute: UISemanticContentAttribute,
527        );
528
529        #[cfg(feature = "UIInterface")]
530        #[unsafe(method(userInterfaceLayoutDirectionForSemanticContentAttribute:))]
531        #[unsafe(method_family = none)]
532        pub unsafe fn userInterfaceLayoutDirectionForSemanticContentAttribute(
533            attribute: UISemanticContentAttribute,
534            mtm: MainThreadMarker,
535        ) -> UIUserInterfaceLayoutDirection;
536
537        #[cfg(feature = "UIInterface")]
538        #[unsafe(method(userInterfaceLayoutDirectionForSemanticContentAttribute:relativeToLayoutDirection:))]
539        #[unsafe(method_family = none)]
540        pub unsafe fn userInterfaceLayoutDirectionForSemanticContentAttribute_relativeToLayoutDirection(
541            semantic_content_attribute: UISemanticContentAttribute,
542            layout_direction: UIUserInterfaceLayoutDirection,
543            mtm: MainThreadMarker,
544        ) -> UIUserInterfaceLayoutDirection;
545
546        #[cfg(feature = "UIInterface")]
547        #[unsafe(method(effectiveUserInterfaceLayoutDirection))]
548        #[unsafe(method_family = none)]
549        pub unsafe fn effectiveUserInterfaceLayoutDirection(
550            &self,
551        ) -> UIUserInterfaceLayoutDirection;
552    );
553}
554
555/// Methods declared on superclass `NSObject`.
556#[cfg(feature = "UIResponder")]
557impl UIView {
558    extern_methods!(
559        #[unsafe(method(init))]
560        #[unsafe(method_family = init)]
561        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
562
563        #[unsafe(method(new))]
564        #[unsafe(method_family = new)]
565        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
566    );
567}
568
569/// UIViewGeometry.
570#[cfg(feature = "UIResponder")]
571impl UIView {
572    extern_methods!(
573        #[cfg(feature = "objc2-core-foundation")]
574        #[unsafe(method(frame))]
575        #[unsafe(method_family = none)]
576        pub fn frame(&self) -> CGRect;
577
578        #[cfg(feature = "objc2-core-foundation")]
579        /// Setter for [`frame`][Self::frame].
580        #[unsafe(method(setFrame:))]
581        #[unsafe(method_family = none)]
582        pub fn setFrame(&self, frame: CGRect);
583
584        #[cfg(feature = "objc2-core-foundation")]
585        #[unsafe(method(bounds))]
586        #[unsafe(method_family = none)]
587        pub fn bounds(&self) -> CGRect;
588
589        #[cfg(feature = "objc2-core-foundation")]
590        /// Setter for [`bounds`][Self::bounds].
591        #[unsafe(method(setBounds:))]
592        #[unsafe(method_family = none)]
593        pub fn setBounds(&self, bounds: CGRect);
594
595        #[cfg(feature = "objc2-core-foundation")]
596        #[unsafe(method(center))]
597        #[unsafe(method_family = none)]
598        pub unsafe fn center(&self) -> CGPoint;
599
600        #[cfg(feature = "objc2-core-foundation")]
601        /// Setter for [`center`][Self::center].
602        #[unsafe(method(setCenter:))]
603        #[unsafe(method_family = none)]
604        pub unsafe fn setCenter(&self, center: CGPoint);
605
606        #[cfg(feature = "objc2-core-foundation")]
607        #[unsafe(method(transform))]
608        #[unsafe(method_family = none)]
609        pub unsafe fn transform(&self) -> CGAffineTransform;
610
611        #[cfg(feature = "objc2-core-foundation")]
612        /// Setter for [`transform`][Self::transform].
613        #[unsafe(method(setTransform:))]
614        #[unsafe(method_family = none)]
615        pub unsafe fn setTransform(&self, transform: CGAffineTransform);
616
617        #[cfg(feature = "objc2-quartz-core")]
618        #[cfg(not(target_os = "watchos"))]
619        #[unsafe(method(transform3D))]
620        #[unsafe(method_family = none)]
621        pub unsafe fn transform3D(&self) -> CATransform3D;
622
623        #[cfg(feature = "objc2-quartz-core")]
624        #[cfg(not(target_os = "watchos"))]
625        /// Setter for [`transform3D`][Self::transform3D].
626        #[unsafe(method(setTransform3D:))]
627        #[unsafe(method_family = none)]
628        pub unsafe fn setTransform3D(&self, transform3_d: CATransform3D);
629
630        #[cfg(feature = "objc2-core-foundation")]
631        #[unsafe(method(contentScaleFactor))]
632        #[unsafe(method_family = none)]
633        pub fn contentScaleFactor(&self) -> CGFloat;
634
635        #[cfg(feature = "objc2-core-foundation")]
636        /// Setter for [`contentScaleFactor`][Self::contentScaleFactor].
637        #[unsafe(method(setContentScaleFactor:))]
638        #[unsafe(method_family = none)]
639        pub fn setContentScaleFactor(&self, content_scale_factor: CGFloat);
640
641        #[cfg(feature = "objc2-core-foundation")]
642        #[unsafe(method(anchorPoint))]
643        #[unsafe(method_family = none)]
644        pub unsafe fn anchorPoint(&self) -> CGPoint;
645
646        #[cfg(feature = "objc2-core-foundation")]
647        /// Setter for [`anchorPoint`][Self::anchorPoint].
648        #[unsafe(method(setAnchorPoint:))]
649        #[unsafe(method_family = none)]
650        pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
651
652        #[unsafe(method(isMultipleTouchEnabled))]
653        #[unsafe(method_family = none)]
654        pub unsafe fn isMultipleTouchEnabled(&self) -> bool;
655
656        /// Setter for [`isMultipleTouchEnabled`][Self::isMultipleTouchEnabled].
657        #[unsafe(method(setMultipleTouchEnabled:))]
658        #[unsafe(method_family = none)]
659        pub fn setMultipleTouchEnabled(&self, multiple_touch_enabled: bool);
660
661        #[unsafe(method(isExclusiveTouch))]
662        #[unsafe(method_family = none)]
663        pub unsafe fn isExclusiveTouch(&self) -> bool;
664
665        /// Setter for [`isExclusiveTouch`][Self::isExclusiveTouch].
666        #[unsafe(method(setExclusiveTouch:))]
667        #[unsafe(method_family = none)]
668        pub unsafe fn setExclusiveTouch(&self, exclusive_touch: bool);
669
670        #[cfg(all(feature = "UIEvent", feature = "objc2-core-foundation"))]
671        #[unsafe(method(hitTest:withEvent:))]
672        #[unsafe(method_family = none)]
673        pub unsafe fn hitTest_withEvent(
674            &self,
675            point: CGPoint,
676            event: Option<&UIEvent>,
677        ) -> Option<Retained<UIView>>;
678
679        #[cfg(all(feature = "UIEvent", feature = "objc2-core-foundation"))]
680        #[unsafe(method(pointInside:withEvent:))]
681        #[unsafe(method_family = none)]
682        pub unsafe fn pointInside_withEvent(&self, point: CGPoint, event: Option<&UIEvent>)
683            -> bool;
684
685        #[cfg(feature = "objc2-core-foundation")]
686        #[unsafe(method(convertPoint:toView:))]
687        #[unsafe(method_family = none)]
688        pub unsafe fn convertPoint_toView(&self, point: CGPoint, view: Option<&UIView>) -> CGPoint;
689
690        #[cfg(feature = "objc2-core-foundation")]
691        #[unsafe(method(convertPoint:fromView:))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn convertPoint_fromView(
694            &self,
695            point: CGPoint,
696            view: Option<&UIView>,
697        ) -> CGPoint;
698
699        #[cfg(feature = "objc2-core-foundation")]
700        #[unsafe(method(convertRect:toView:))]
701        #[unsafe(method_family = none)]
702        pub unsafe fn convertRect_toView(&self, rect: CGRect, view: Option<&UIView>) -> CGRect;
703
704        #[cfg(feature = "objc2-core-foundation")]
705        #[unsafe(method(convertRect:fromView:))]
706        #[unsafe(method_family = none)]
707        pub unsafe fn convertRect_fromView(&self, rect: CGRect, view: Option<&UIView>) -> CGRect;
708
709        #[unsafe(method(autoresizesSubviews))]
710        #[unsafe(method_family = none)]
711        pub unsafe fn autoresizesSubviews(&self) -> bool;
712
713        /// Setter for [`autoresizesSubviews`][Self::autoresizesSubviews].
714        #[unsafe(method(setAutoresizesSubviews:))]
715        #[unsafe(method_family = none)]
716        pub unsafe fn setAutoresizesSubviews(&self, autoresizes_subviews: bool);
717
718        #[unsafe(method(autoresizingMask))]
719        #[unsafe(method_family = none)]
720        pub unsafe fn autoresizingMask(&self) -> UIViewAutoresizing;
721
722        /// Setter for [`autoresizingMask`][Self::autoresizingMask].
723        #[unsafe(method(setAutoresizingMask:))]
724        #[unsafe(method_family = none)]
725        pub unsafe fn setAutoresizingMask(&self, autoresizing_mask: UIViewAutoresizing);
726
727        #[cfg(feature = "objc2-core-foundation")]
728        #[unsafe(method(sizeThatFits:))]
729        #[unsafe(method_family = none)]
730        pub unsafe fn sizeThatFits(&self, size: CGSize) -> CGSize;
731
732        #[unsafe(method(sizeToFit))]
733        #[unsafe(method_family = none)]
734        pub unsafe fn sizeToFit(&self);
735    );
736}
737
738/// UIViewHierarchy.
739#[cfg(feature = "UIResponder")]
740impl UIView {
741    extern_methods!(
742        #[unsafe(method(superview))]
743        #[unsafe(method_family = none)]
744        pub fn superview(&self) -> Option<Retained<UIView>>;
745
746        #[unsafe(method(subviews))]
747        #[unsafe(method_family = none)]
748        pub fn subviews(&self) -> Retained<NSArray<UIView>>;
749
750        #[cfg(feature = "UIWindow")]
751        #[unsafe(method(window))]
752        #[unsafe(method_family = none)]
753        pub fn window(&self) -> Option<Retained<UIWindow>>;
754
755        #[unsafe(method(removeFromSuperview))]
756        #[unsafe(method_family = none)]
757        pub unsafe fn removeFromSuperview(&self);
758
759        #[unsafe(method(insertSubview:atIndex:))]
760        #[unsafe(method_family = none)]
761        pub unsafe fn insertSubview_atIndex(&self, view: &UIView, index: NSInteger);
762
763        #[unsafe(method(exchangeSubviewAtIndex:withSubviewAtIndex:))]
764        #[unsafe(method_family = none)]
765        pub unsafe fn exchangeSubviewAtIndex_withSubviewAtIndex(
766            &self,
767            index1: NSInteger,
768            index2: NSInteger,
769        );
770
771        #[unsafe(method(addSubview:))]
772        #[unsafe(method_family = none)]
773        pub unsafe fn addSubview(&self, view: &UIView);
774
775        #[unsafe(method(insertSubview:belowSubview:))]
776        #[unsafe(method_family = none)]
777        pub unsafe fn insertSubview_belowSubview(&self, view: &UIView, sibling_subview: &UIView);
778
779        #[unsafe(method(insertSubview:aboveSubview:))]
780        #[unsafe(method_family = none)]
781        pub unsafe fn insertSubview_aboveSubview(&self, view: &UIView, sibling_subview: &UIView);
782
783        #[unsafe(method(bringSubviewToFront:))]
784        #[unsafe(method_family = none)]
785        pub unsafe fn bringSubviewToFront(&self, view: &UIView);
786
787        #[unsafe(method(sendSubviewToBack:))]
788        #[unsafe(method_family = none)]
789        pub unsafe fn sendSubviewToBack(&self, view: &UIView);
790
791        #[unsafe(method(didAddSubview:))]
792        #[unsafe(method_family = none)]
793        pub unsafe fn didAddSubview(&self, subview: &UIView);
794
795        #[unsafe(method(willRemoveSubview:))]
796        #[unsafe(method_family = none)]
797        pub unsafe fn willRemoveSubview(&self, subview: &UIView);
798
799        #[unsafe(method(willMoveToSuperview:))]
800        #[unsafe(method_family = none)]
801        pub unsafe fn willMoveToSuperview(&self, new_superview: Option<&UIView>);
802
803        #[unsafe(method(didMoveToSuperview))]
804        #[unsafe(method_family = none)]
805        pub unsafe fn didMoveToSuperview(&self);
806
807        #[cfg(feature = "UIWindow")]
808        #[unsafe(method(willMoveToWindow:))]
809        #[unsafe(method_family = none)]
810        pub unsafe fn willMoveToWindow(&self, new_window: Option<&UIWindow>);
811
812        #[unsafe(method(didMoveToWindow))]
813        #[unsafe(method_family = none)]
814        pub unsafe fn didMoveToWindow(&self);
815
816        #[unsafe(method(isDescendantOfView:))]
817        #[unsafe(method_family = none)]
818        pub unsafe fn isDescendantOfView(&self, view: &UIView) -> bool;
819
820        #[unsafe(method(viewWithTag:))]
821        #[unsafe(method_family = none)]
822        pub unsafe fn viewWithTag(&self, tag: NSInteger) -> Option<Retained<UIView>>;
823
824        #[unsafe(method(setNeedsLayout))]
825        #[unsafe(method_family = none)]
826        pub unsafe fn setNeedsLayout(&self);
827
828        #[unsafe(method(layoutIfNeeded))]
829        #[unsafe(method_family = none)]
830        pub unsafe fn layoutIfNeeded(&self);
831
832        #[unsafe(method(layoutSubviews))]
833        #[unsafe(method_family = none)]
834        pub unsafe fn layoutSubviews(&self);
835
836        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
837        #[unsafe(method(layoutMargins))]
838        #[unsafe(method_family = none)]
839        pub unsafe fn layoutMargins(&self) -> UIEdgeInsets;
840
841        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
842        /// Setter for [`layoutMargins`][Self::layoutMargins].
843        #[unsafe(method(setLayoutMargins:))]
844        #[unsafe(method_family = none)]
845        pub unsafe fn setLayoutMargins(&self, layout_margins: UIEdgeInsets);
846
847        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
848        #[unsafe(method(directionalLayoutMargins))]
849        #[unsafe(method_family = none)]
850        pub unsafe fn directionalLayoutMargins(&self) -> NSDirectionalEdgeInsets;
851
852        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
853        /// Setter for [`directionalLayoutMargins`][Self::directionalLayoutMargins].
854        #[unsafe(method(setDirectionalLayoutMargins:))]
855        #[unsafe(method_family = none)]
856        pub unsafe fn setDirectionalLayoutMargins(
857            &self,
858            directional_layout_margins: NSDirectionalEdgeInsets,
859        );
860
861        #[unsafe(method(preservesSuperviewLayoutMargins))]
862        #[unsafe(method_family = none)]
863        pub unsafe fn preservesSuperviewLayoutMargins(&self) -> bool;
864
865        /// Setter for [`preservesSuperviewLayoutMargins`][Self::preservesSuperviewLayoutMargins].
866        #[unsafe(method(setPreservesSuperviewLayoutMargins:))]
867        #[unsafe(method_family = none)]
868        pub unsafe fn setPreservesSuperviewLayoutMargins(
869            &self,
870            preserves_superview_layout_margins: bool,
871        );
872
873        #[unsafe(method(insetsLayoutMarginsFromSafeArea))]
874        #[unsafe(method_family = none)]
875        pub unsafe fn insetsLayoutMarginsFromSafeArea(&self) -> bool;
876
877        /// Setter for [`insetsLayoutMarginsFromSafeArea`][Self::insetsLayoutMarginsFromSafeArea].
878        #[unsafe(method(setInsetsLayoutMarginsFromSafeArea:))]
879        #[unsafe(method_family = none)]
880        pub unsafe fn setInsetsLayoutMarginsFromSafeArea(
881            &self,
882            insets_layout_margins_from_safe_area: bool,
883        );
884
885        #[unsafe(method(layoutMarginsDidChange))]
886        #[unsafe(method_family = none)]
887        pub unsafe fn layoutMarginsDidChange(&self);
888
889        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
890        #[unsafe(method(safeAreaInsets))]
891        #[unsafe(method_family = none)]
892        pub fn safeAreaInsets(&self) -> UIEdgeInsets;
893
894        #[unsafe(method(safeAreaInsetsDidChange))]
895        #[unsafe(method_family = none)]
896        pub unsafe fn safeAreaInsetsDidChange(&self);
897
898        #[cfg(feature = "UILayoutGuide")]
899        #[unsafe(method(layoutMarginsGuide))]
900        #[unsafe(method_family = none)]
901        pub unsafe fn layoutMarginsGuide(&self) -> Retained<UILayoutGuide>;
902
903        #[cfg(feature = "UILayoutGuide")]
904        /// This content guide provides a layout area that you can use to place text and related content whose width should generally be constrained to a size that is easy for the user to read. This guide provides a centered region that you can place content within to get this behavior for this view.
905        #[unsafe(method(readableContentGuide))]
906        #[unsafe(method_family = none)]
907        pub unsafe fn readableContentGuide(&self) -> Retained<UILayoutGuide>;
908
909        #[cfg(feature = "UILayoutGuide")]
910        #[unsafe(method(safeAreaLayoutGuide))]
911        #[unsafe(method_family = none)]
912        pub unsafe fn safeAreaLayoutGuide(&self) -> Retained<UILayoutGuide>;
913
914        #[cfg(all(
915            feature = "UIKeyboardLayoutGuide",
916            feature = "UILayoutGuide",
917            feature = "UITrackingLayoutGuide"
918        ))]
919        /// Follows the keyboard when on screen and docked. See UIKeyboardLayoutGuide.h for additional options.
920        #[unsafe(method(keyboardLayoutGuide))]
921        #[unsafe(method_family = none)]
922        pub unsafe fn keyboardLayoutGuide(&self) -> Retained<UIKeyboardLayoutGuide>;
923    );
924}
925
926/// UIViewRendering.
927#[cfg(feature = "UIResponder")]
928impl UIView {
929    extern_methods!(
930        #[cfg(feature = "objc2-core-foundation")]
931        #[unsafe(method(drawRect:))]
932        #[unsafe(method_family = none)]
933        pub unsafe fn drawRect(&self, rect: CGRect);
934
935        #[unsafe(method(setNeedsDisplay))]
936        #[unsafe(method_family = none)]
937        pub fn setNeedsDisplay(&self);
938
939        #[cfg(feature = "objc2-core-foundation")]
940        #[unsafe(method(setNeedsDisplayInRect:))]
941        #[unsafe(method_family = none)]
942        pub unsafe fn setNeedsDisplayInRect(&self, rect: CGRect);
943
944        #[unsafe(method(clipsToBounds))]
945        #[unsafe(method_family = none)]
946        pub unsafe fn clipsToBounds(&self) -> bool;
947
948        /// Setter for [`clipsToBounds`][Self::clipsToBounds].
949        #[unsafe(method(setClipsToBounds:))]
950        #[unsafe(method_family = none)]
951        pub unsafe fn setClipsToBounds(&self, clips_to_bounds: bool);
952
953        #[cfg(feature = "UIColor")]
954        #[unsafe(method(backgroundColor))]
955        #[unsafe(method_family = none)]
956        pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
957
958        #[cfg(feature = "UIColor")]
959        /// Setter for [`backgroundColor`][Self::backgroundColor].
960        #[unsafe(method(setBackgroundColor:))]
961        #[unsafe(method_family = none)]
962        pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
963
964        #[cfg(feature = "objc2-core-foundation")]
965        #[unsafe(method(alpha))]
966        #[unsafe(method_family = none)]
967        pub unsafe fn alpha(&self) -> CGFloat;
968
969        #[cfg(feature = "objc2-core-foundation")]
970        /// Setter for [`alpha`][Self::alpha].
971        #[unsafe(method(setAlpha:))]
972        #[unsafe(method_family = none)]
973        pub unsafe fn setAlpha(&self, alpha: CGFloat);
974
975        #[unsafe(method(isOpaque))]
976        #[unsafe(method_family = none)]
977        pub unsafe fn isOpaque(&self) -> bool;
978
979        /// Setter for [`isOpaque`][Self::isOpaque].
980        #[unsafe(method(setOpaque:))]
981        #[unsafe(method_family = none)]
982        pub unsafe fn setOpaque(&self, opaque: bool);
983
984        #[unsafe(method(clearsContextBeforeDrawing))]
985        #[unsafe(method_family = none)]
986        pub unsafe fn clearsContextBeforeDrawing(&self) -> bool;
987
988        /// Setter for [`clearsContextBeforeDrawing`][Self::clearsContextBeforeDrawing].
989        #[unsafe(method(setClearsContextBeforeDrawing:))]
990        #[unsafe(method_family = none)]
991        pub unsafe fn setClearsContextBeforeDrawing(&self, clears_context_before_drawing: bool);
992
993        #[unsafe(method(isHidden))]
994        #[unsafe(method_family = none)]
995        pub fn isHidden(&self) -> bool;
996
997        /// Setter for [`isHidden`][Self::isHidden].
998        #[unsafe(method(setHidden:))]
999        #[unsafe(method_family = none)]
1000        pub fn setHidden(&self, hidden: bool);
1001
1002        #[unsafe(method(contentMode))]
1003        #[unsafe(method_family = none)]
1004        pub unsafe fn contentMode(&self) -> UIViewContentMode;
1005
1006        /// Setter for [`contentMode`][Self::contentMode].
1007        #[unsafe(method(setContentMode:))]
1008        #[unsafe(method_family = none)]
1009        pub unsafe fn setContentMode(&self, content_mode: UIViewContentMode);
1010
1011        #[cfg(feature = "objc2-core-foundation")]
1012        #[deprecated]
1013        #[unsafe(method(contentStretch))]
1014        #[unsafe(method_family = none)]
1015        pub unsafe fn contentStretch(&self) -> CGRect;
1016
1017        #[cfg(feature = "objc2-core-foundation")]
1018        /// Setter for [`contentStretch`][Self::contentStretch].
1019        #[deprecated]
1020        #[unsafe(method(setContentStretch:))]
1021        #[unsafe(method_family = none)]
1022        pub unsafe fn setContentStretch(&self, content_stretch: CGRect);
1023
1024        #[unsafe(method(maskView))]
1025        #[unsafe(method_family = none)]
1026        pub unsafe fn maskView(&self) -> Option<Retained<UIView>>;
1027
1028        /// Setter for [`maskView`][Self::maskView].
1029        #[unsafe(method(setMaskView:))]
1030        #[unsafe(method_family = none)]
1031        pub unsafe fn setMaskView(&self, mask_view: Option<&UIView>);
1032
1033        #[cfg(feature = "UIColor")]
1034        #[unsafe(method(tintColor))]
1035        #[unsafe(method_family = none)]
1036        pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
1037
1038        #[cfg(feature = "UIColor")]
1039        /// Setter for [`tintColor`][Self::tintColor].
1040        #[unsafe(method(setTintColor:))]
1041        #[unsafe(method_family = none)]
1042        pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
1043
1044        #[unsafe(method(tintAdjustmentMode))]
1045        #[unsafe(method_family = none)]
1046        pub unsafe fn tintAdjustmentMode(&self) -> UIViewTintAdjustmentMode;
1047
1048        /// Setter for [`tintAdjustmentMode`][Self::tintAdjustmentMode].
1049        #[unsafe(method(setTintAdjustmentMode:))]
1050        #[unsafe(method_family = none)]
1051        pub unsafe fn setTintAdjustmentMode(&self, tint_adjustment_mode: UIViewTintAdjustmentMode);
1052
1053        #[unsafe(method(tintColorDidChange))]
1054        #[unsafe(method_family = none)]
1055        pub unsafe fn tintColorDidChange(&self);
1056    );
1057}
1058
1059/// UIViewAnimation.
1060#[cfg(feature = "UIResponder")]
1061impl UIView {
1062    extern_methods!(
1063        #[unsafe(method(setAnimationsEnabled:))]
1064        #[unsafe(method_family = none)]
1065        pub unsafe fn setAnimationsEnabled(enabled: bool, mtm: MainThreadMarker);
1066
1067        #[unsafe(method(areAnimationsEnabled))]
1068        #[unsafe(method_family = none)]
1069        pub unsafe fn areAnimationsEnabled(mtm: MainThreadMarker) -> bool;
1070
1071        #[cfg(feature = "block2")]
1072        #[unsafe(method(performWithoutAnimation:))]
1073        #[unsafe(method_family = none)]
1074        pub unsafe fn performWithoutAnimation(
1075            actions_without_animation: &block2::DynBlock<dyn Fn() + '_>,
1076            mtm: MainThreadMarker,
1077        );
1078
1079        #[unsafe(method(inheritedAnimationDuration))]
1080        #[unsafe(method_family = none)]
1081        pub unsafe fn inheritedAnimationDuration(mtm: MainThreadMarker) -> NSTimeInterval;
1082    );
1083}
1084
1085/// UIViewAnimationWithBlocks.
1086#[cfg(feature = "UIResponder")]
1087impl UIView {
1088    extern_methods!(
1089        #[cfg(feature = "block2")]
1090        #[unsafe(method(animateWithDuration:delay:options:animations:completion:))]
1091        #[unsafe(method_family = none)]
1092        pub unsafe fn animateWithDuration_delay_options_animations_completion(
1093            duration: NSTimeInterval,
1094            delay: NSTimeInterval,
1095            options: UIViewAnimationOptions,
1096            animations: &block2::DynBlock<dyn Fn()>,
1097            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1098            mtm: MainThreadMarker,
1099        );
1100
1101        #[cfg(feature = "block2")]
1102        #[unsafe(method(animateWithDuration:animations:completion:))]
1103        #[unsafe(method_family = none)]
1104        pub unsafe fn animateWithDuration_animations_completion(
1105            duration: NSTimeInterval,
1106            animations: &block2::DynBlock<dyn Fn()>,
1107            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1108            mtm: MainThreadMarker,
1109        );
1110
1111        #[cfg(feature = "block2")]
1112        #[unsafe(method(animateWithDuration:animations:))]
1113        #[unsafe(method_family = none)]
1114        pub unsafe fn animateWithDuration_animations(
1115            duration: NSTimeInterval,
1116            animations: &block2::DynBlock<dyn Fn()>,
1117            mtm: MainThreadMarker,
1118        );
1119
1120        #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
1121        #[unsafe(method(animateWithSpringDuration:bounce:initialSpringVelocity:delay:options:animations:completion:))]
1122        #[unsafe(method_family = none)]
1123        pub unsafe fn animateWithSpringDuration_bounce_initialSpringVelocity_delay_options_animations_completion(
1124            duration: NSTimeInterval,
1125            bounce: CGFloat,
1126            velocity: CGFloat,
1127            delay: NSTimeInterval,
1128            options: UIViewAnimationOptions,
1129            animations: &block2::DynBlock<dyn Fn() + '_>,
1130            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1131            mtm: MainThreadMarker,
1132        );
1133
1134        #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
1135        #[unsafe(method(animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:))]
1136        #[unsafe(method_family = none)]
1137        pub unsafe fn animateWithDuration_delay_usingSpringWithDamping_initialSpringVelocity_options_animations_completion(
1138            duration: NSTimeInterval,
1139            delay: NSTimeInterval,
1140            damping_ratio: CGFloat,
1141            velocity: CGFloat,
1142            options: UIViewAnimationOptions,
1143            animations: &block2::DynBlock<dyn Fn()>,
1144            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1145            mtm: MainThreadMarker,
1146        );
1147
1148        #[cfg(feature = "block2")]
1149        #[unsafe(method(transitionWithView:duration:options:animations:completion:))]
1150        #[unsafe(method_family = none)]
1151        pub unsafe fn transitionWithView_duration_options_animations_completion(
1152            view: &UIView,
1153            duration: NSTimeInterval,
1154            options: UIViewAnimationOptions,
1155            animations: Option<&block2::DynBlock<dyn Fn()>>,
1156            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1157        );
1158
1159        #[cfg(feature = "block2")]
1160        #[unsafe(method(transitionFromView:toView:duration:options:completion:))]
1161        #[unsafe(method_family = none)]
1162        pub unsafe fn transitionFromView_toView_duration_options_completion(
1163            from_view: &UIView,
1164            to_view: &UIView,
1165            duration: NSTimeInterval,
1166            options: UIViewAnimationOptions,
1167            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1168        );
1169
1170        #[cfg(feature = "block2")]
1171        #[unsafe(method(performSystemAnimation:onViews:options:animations:completion:))]
1172        #[unsafe(method_family = none)]
1173        pub unsafe fn performSystemAnimation_onViews_options_animations_completion(
1174            animation: UISystemAnimation,
1175            views: &NSArray<UIView>,
1176            options: UIViewAnimationOptions,
1177            parallel_animations: Option<&block2::DynBlock<dyn Fn()>>,
1178            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1179            mtm: MainThreadMarker,
1180        );
1181
1182        #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
1183        #[unsafe(method(modifyAnimationsWithRepeatCount:autoreverses:animations:))]
1184        #[unsafe(method_family = none)]
1185        pub unsafe fn modifyAnimationsWithRepeatCount_autoreverses_animations(
1186            count: CGFloat,
1187            autoreverses: bool,
1188            animations: &block2::DynBlock<dyn Fn() + '_>,
1189            mtm: MainThreadMarker,
1190        );
1191    );
1192}
1193
1194/// UIViewKeyframeAnimations.
1195#[cfg(feature = "UIResponder")]
1196impl UIView {
1197    extern_methods!(
1198        #[cfg(feature = "block2")]
1199        #[unsafe(method(animateKeyframesWithDuration:delay:options:animations:completion:))]
1200        #[unsafe(method_family = none)]
1201        pub unsafe fn animateKeyframesWithDuration_delay_options_animations_completion(
1202            duration: NSTimeInterval,
1203            delay: NSTimeInterval,
1204            options: UIViewKeyframeAnimationOptions,
1205            animations: &block2::DynBlock<dyn Fn()>,
1206            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
1207            mtm: MainThreadMarker,
1208        );
1209
1210        #[cfg(feature = "block2")]
1211        #[unsafe(method(addKeyframeWithRelativeStartTime:relativeDuration:animations:))]
1212        #[unsafe(method_family = none)]
1213        pub unsafe fn addKeyframeWithRelativeStartTime_relativeDuration_animations(
1214            frame_start_time: c_double,
1215            frame_duration: c_double,
1216            animations: &block2::DynBlock<dyn Fn()>,
1217            mtm: MainThreadMarker,
1218        );
1219    );
1220}
1221
1222/// UIViewGestureRecognizers.
1223#[cfg(feature = "UIResponder")]
1224impl UIView {
1225    extern_methods!(
1226        #[cfg(feature = "UIGestureRecognizer")]
1227        #[unsafe(method(gestureRecognizers))]
1228        #[unsafe(method_family = none)]
1229        pub fn gestureRecognizers(&self) -> Option<Retained<NSArray<UIGestureRecognizer>>>;
1230
1231        #[cfg(feature = "UIGestureRecognizer")]
1232        /// Setter for [`gestureRecognizers`][Self::gestureRecognizers].
1233        #[unsafe(method(setGestureRecognizers:))]
1234        #[unsafe(method_family = none)]
1235        pub unsafe fn setGestureRecognizers(
1236            &self,
1237            gesture_recognizers: Option<&NSArray<UIGestureRecognizer>>,
1238        );
1239
1240        #[cfg(feature = "UIGestureRecognizer")]
1241        #[unsafe(method(addGestureRecognizer:))]
1242        #[unsafe(method_family = none)]
1243        pub fn addGestureRecognizer(&self, gesture_recognizer: &UIGestureRecognizer);
1244
1245        #[cfg(feature = "UIGestureRecognizer")]
1246        #[unsafe(method(removeGestureRecognizer:))]
1247        #[unsafe(method_family = none)]
1248        pub fn removeGestureRecognizer(&self, gesture_recognizer: &UIGestureRecognizer);
1249
1250        #[cfg(feature = "UIGestureRecognizer")]
1251        #[unsafe(method(gestureRecognizerShouldBegin:))]
1252        #[unsafe(method_family = none)]
1253        pub fn gestureRecognizerShouldBegin(
1254            &self,
1255            gesture_recognizer: &UIGestureRecognizer,
1256        ) -> bool;
1257    );
1258}
1259
1260/// UIViewMotionEffects.
1261#[cfg(feature = "UIResponder")]
1262impl UIView {
1263    extern_methods!(
1264        #[cfg(feature = "UIMotionEffect")]
1265        /// Begins applying `effect` to the receiver. The effect's emitted keyPath/value pairs will be
1266        /// applied to the view's presentation layer.
1267        ///
1268        /// Animates the transition to the motion effect's values using the present UIView animation
1269        /// context.
1270        #[unsafe(method(addMotionEffect:))]
1271        #[unsafe(method_family = none)]
1272        pub unsafe fn addMotionEffect(&self, effect: &UIMotionEffect);
1273
1274        #[cfg(feature = "UIMotionEffect")]
1275        /// Stops applying `effect` to the receiver. Any affected presentation values will animate to
1276        /// their post-removal values using the present UIView animation context.
1277        #[unsafe(method(removeMotionEffect:))]
1278        #[unsafe(method_family = none)]
1279        pub unsafe fn removeMotionEffect(&self, effect: &UIMotionEffect);
1280
1281        #[cfg(feature = "UIMotionEffect")]
1282        #[unsafe(method(motionEffects))]
1283        #[unsafe(method_family = none)]
1284        pub unsafe fn motionEffects(&self) -> Retained<NSArray<UIMotionEffect>>;
1285
1286        #[cfg(feature = "UIMotionEffect")]
1287        /// Setter for [`motionEffects`][Self::motionEffects].
1288        #[unsafe(method(setMotionEffects:))]
1289        #[unsafe(method_family = none)]
1290        pub unsafe fn setMotionEffects(&self, motion_effects: &NSArray<UIMotionEffect>);
1291    );
1292}
1293
1294/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilayoutconstraintaxis?language=objc)
1295// NS_ENUM
1296#[repr(transparent)]
1297#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1298pub struct UILayoutConstraintAxis(pub NSInteger);
1299impl UILayoutConstraintAxis {
1300    #[doc(alias = "UILayoutConstraintAxisHorizontal")]
1301    pub const Horizontal: Self = Self(0);
1302    #[doc(alias = "UILayoutConstraintAxisVertical")]
1303    pub const Vertical: Self = Self(1);
1304}
1305
1306unsafe impl Encode for UILayoutConstraintAxis {
1307    const ENCODING: Encoding = NSInteger::ENCODING;
1308}
1309
1310unsafe impl RefEncode for UILayoutConstraintAxis {
1311    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1312}
1313
1314/// UIConstraintBasedLayoutInstallingConstraints.
1315#[cfg(feature = "UIResponder")]
1316impl UIView {
1317    extern_methods!(
1318        #[cfg(feature = "NSLayoutConstraint")]
1319        #[unsafe(method(constraints))]
1320        #[unsafe(method_family = none)]
1321        pub unsafe fn constraints(&self) -> Retained<NSArray<NSLayoutConstraint>>;
1322
1323        #[cfg(feature = "NSLayoutConstraint")]
1324        #[unsafe(method(addConstraint:))]
1325        #[unsafe(method_family = none)]
1326        pub unsafe fn addConstraint(&self, constraint: &NSLayoutConstraint);
1327
1328        #[cfg(feature = "NSLayoutConstraint")]
1329        #[unsafe(method(addConstraints:))]
1330        #[unsafe(method_family = none)]
1331        pub unsafe fn addConstraints(&self, constraints: &NSArray<NSLayoutConstraint>);
1332
1333        #[cfg(feature = "NSLayoutConstraint")]
1334        #[unsafe(method(removeConstraint:))]
1335        #[unsafe(method_family = none)]
1336        pub unsafe fn removeConstraint(&self, constraint: &NSLayoutConstraint);
1337
1338        #[cfg(feature = "NSLayoutConstraint")]
1339        #[unsafe(method(removeConstraints:))]
1340        #[unsafe(method_family = none)]
1341        pub unsafe fn removeConstraints(&self, constraints: &NSArray<NSLayoutConstraint>);
1342    );
1343}
1344
1345/// UIConstraintBasedLayoutCoreMethods.
1346#[cfg(feature = "UIResponder")]
1347impl UIView {
1348    extern_methods!(
1349        #[unsafe(method(updateConstraintsIfNeeded))]
1350        #[unsafe(method_family = none)]
1351        pub unsafe fn updateConstraintsIfNeeded(&self);
1352
1353        #[unsafe(method(updateConstraints))]
1354        #[unsafe(method_family = none)]
1355        pub unsafe fn updateConstraints(&self);
1356
1357        #[unsafe(method(needsUpdateConstraints))]
1358        #[unsafe(method_family = none)]
1359        pub unsafe fn needsUpdateConstraints(&self) -> bool;
1360
1361        #[unsafe(method(setNeedsUpdateConstraints))]
1362        #[unsafe(method_family = none)]
1363        pub unsafe fn setNeedsUpdateConstraints(&self);
1364    );
1365}
1366
1367/// UIConstraintBasedCompatibility.
1368#[cfg(feature = "UIResponder")]
1369impl UIView {
1370    extern_methods!(
1371        #[unsafe(method(translatesAutoresizingMaskIntoConstraints))]
1372        #[unsafe(method_family = none)]
1373        pub unsafe fn translatesAutoresizingMaskIntoConstraints(&self) -> bool;
1374
1375        /// Setter for [`translatesAutoresizingMaskIntoConstraints`][Self::translatesAutoresizingMaskIntoConstraints].
1376        #[unsafe(method(setTranslatesAutoresizingMaskIntoConstraints:))]
1377        #[unsafe(method_family = none)]
1378        pub unsafe fn setTranslatesAutoresizingMaskIntoConstraints(
1379            &self,
1380            translates_autoresizing_mask_into_constraints: bool,
1381        );
1382
1383        #[unsafe(method(requiresConstraintBasedLayout))]
1384        #[unsafe(method_family = none)]
1385        pub unsafe fn requiresConstraintBasedLayout(mtm: MainThreadMarker) -> bool;
1386    );
1387}
1388
1389extern "C" {
1390    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewnointrinsicmetric?language=objc)
1391    #[cfg(feature = "objc2-core-foundation")]
1392    pub static UIViewNoIntrinsicMetric: CGFloat;
1393}
1394
1395/// UIConstraintBasedLayoutLayering.
1396#[cfg(feature = "UIResponder")]
1397impl UIView {
1398    extern_methods!(
1399        #[cfg(feature = "objc2-core-foundation")]
1400        #[unsafe(method(alignmentRectForFrame:))]
1401        #[unsafe(method_family = none)]
1402        pub unsafe fn alignmentRectForFrame(&self, frame: CGRect) -> CGRect;
1403
1404        #[cfg(feature = "objc2-core-foundation")]
1405        #[unsafe(method(frameForAlignmentRect:))]
1406        #[unsafe(method_family = none)]
1407        pub unsafe fn frameForAlignmentRect(&self, alignment_rect: CGRect) -> CGRect;
1408
1409        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1410        #[unsafe(method(alignmentRectInsets))]
1411        #[unsafe(method_family = none)]
1412        pub unsafe fn alignmentRectInsets(&self) -> UIEdgeInsets;
1413
1414        #[deprecated = "Override -viewForFirstBaselineLayout or -viewForLastBaselineLayout as appropriate, instead"]
1415        #[unsafe(method(viewForBaselineLayout))]
1416        #[unsafe(method_family = none)]
1417        pub unsafe fn viewForBaselineLayout(&self) -> Retained<UIView>;
1418
1419        #[unsafe(method(viewForFirstBaselineLayout))]
1420        #[unsafe(method_family = none)]
1421        pub unsafe fn viewForFirstBaselineLayout(&self) -> Retained<UIView>;
1422
1423        #[unsafe(method(viewForLastBaselineLayout))]
1424        #[unsafe(method_family = none)]
1425        pub unsafe fn viewForLastBaselineLayout(&self) -> Retained<UIView>;
1426
1427        #[cfg(feature = "objc2-core-foundation")]
1428        #[unsafe(method(intrinsicContentSize))]
1429        #[unsafe(method_family = none)]
1430        pub unsafe fn intrinsicContentSize(&self) -> CGSize;
1431
1432        #[unsafe(method(invalidateIntrinsicContentSize))]
1433        #[unsafe(method_family = none)]
1434        pub unsafe fn invalidateIntrinsicContentSize(&self);
1435
1436        #[cfg(feature = "NSLayoutConstraint")]
1437        #[unsafe(method(contentHuggingPriorityForAxis:))]
1438        #[unsafe(method_family = none)]
1439        pub unsafe fn contentHuggingPriorityForAxis(
1440            &self,
1441            axis: UILayoutConstraintAxis,
1442        ) -> UILayoutPriority;
1443
1444        #[cfg(feature = "NSLayoutConstraint")]
1445        #[unsafe(method(setContentHuggingPriority:forAxis:))]
1446        #[unsafe(method_family = none)]
1447        pub unsafe fn setContentHuggingPriority_forAxis(
1448            &self,
1449            priority: UILayoutPriority,
1450            axis: UILayoutConstraintAxis,
1451        );
1452
1453        #[cfg(feature = "NSLayoutConstraint")]
1454        #[unsafe(method(contentCompressionResistancePriorityForAxis:))]
1455        #[unsafe(method_family = none)]
1456        pub unsafe fn contentCompressionResistancePriorityForAxis(
1457            &self,
1458            axis: UILayoutConstraintAxis,
1459        ) -> UILayoutPriority;
1460
1461        #[cfg(feature = "NSLayoutConstraint")]
1462        #[unsafe(method(setContentCompressionResistancePriority:forAxis:))]
1463        #[unsafe(method_family = none)]
1464        pub unsafe fn setContentCompressionResistancePriority_forAxis(
1465            &self,
1466            priority: UILayoutPriority,
1467            axis: UILayoutConstraintAxis,
1468        );
1469    );
1470}
1471
1472extern "C" {
1473    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilayoutfittingcompressedsize?language=objc)
1474    #[cfg(feature = "objc2-core-foundation")]
1475    pub static UILayoutFittingCompressedSize: CGSize;
1476}
1477
1478extern "C" {
1479    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilayoutfittingexpandedsize?language=objc)
1480    #[cfg(feature = "objc2-core-foundation")]
1481    pub static UILayoutFittingExpandedSize: CGSize;
1482}
1483
1484/// UIConstraintBasedLayoutFittingSize.
1485#[cfg(feature = "UIResponder")]
1486impl UIView {
1487    extern_methods!(
1488        #[cfg(feature = "objc2-core-foundation")]
1489        #[unsafe(method(systemLayoutSizeFittingSize:))]
1490        #[unsafe(method_family = none)]
1491        pub unsafe fn systemLayoutSizeFittingSize(&self, target_size: CGSize) -> CGSize;
1492
1493        #[cfg(all(feature = "NSLayoutConstraint", feature = "objc2-core-foundation"))]
1494        #[unsafe(method(systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:))]
1495        #[unsafe(method_family = none)]
1496        pub unsafe fn systemLayoutSizeFittingSize_withHorizontalFittingPriority_verticalFittingPriority(
1497            &self,
1498            target_size: CGSize,
1499            horizontal_fitting_priority: UILayoutPriority,
1500            vertical_fitting_priority: UILayoutPriority,
1501        ) -> CGSize;
1502    );
1503}
1504
1505/// UILayoutGuideSupport.
1506#[cfg(feature = "UIResponder")]
1507impl UIView {
1508    extern_methods!(
1509        #[cfg(feature = "UILayoutGuide")]
1510        #[unsafe(method(layoutGuides))]
1511        #[unsafe(method_family = none)]
1512        pub unsafe fn layoutGuides(&self) -> Retained<NSArray<UILayoutGuide>>;
1513
1514        #[cfg(feature = "UILayoutGuide")]
1515        #[unsafe(method(addLayoutGuide:))]
1516        #[unsafe(method_family = none)]
1517        pub unsafe fn addLayoutGuide(&self, layout_guide: &UILayoutGuide);
1518
1519        #[cfg(feature = "UILayoutGuide")]
1520        #[unsafe(method(removeLayoutGuide:))]
1521        #[unsafe(method_family = none)]
1522        pub unsafe fn removeLayoutGuide(&self, layout_guide: &UILayoutGuide);
1523    );
1524}
1525
1526/// UIViewLayoutConstraintCreation.
1527#[cfg(feature = "UIResponder")]
1528impl UIView {
1529    extern_methods!(
1530        #[cfg(feature = "NSLayoutAnchor")]
1531        #[unsafe(method(leadingAnchor))]
1532        #[unsafe(method_family = none)]
1533        pub unsafe fn leadingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1534
1535        #[cfg(feature = "NSLayoutAnchor")]
1536        #[unsafe(method(trailingAnchor))]
1537        #[unsafe(method_family = none)]
1538        pub unsafe fn trailingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1539
1540        #[cfg(feature = "NSLayoutAnchor")]
1541        #[unsafe(method(leftAnchor))]
1542        #[unsafe(method_family = none)]
1543        pub unsafe fn leftAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1544
1545        #[cfg(feature = "NSLayoutAnchor")]
1546        #[unsafe(method(rightAnchor))]
1547        #[unsafe(method_family = none)]
1548        pub unsafe fn rightAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1549
1550        #[cfg(feature = "NSLayoutAnchor")]
1551        #[unsafe(method(topAnchor))]
1552        #[unsafe(method_family = none)]
1553        pub unsafe fn topAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1554
1555        #[cfg(feature = "NSLayoutAnchor")]
1556        #[unsafe(method(bottomAnchor))]
1557        #[unsafe(method_family = none)]
1558        pub unsafe fn bottomAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1559
1560        #[cfg(feature = "NSLayoutAnchor")]
1561        #[unsafe(method(widthAnchor))]
1562        #[unsafe(method_family = none)]
1563        pub unsafe fn widthAnchor(&self) -> Retained<NSLayoutDimension>;
1564
1565        #[cfg(feature = "NSLayoutAnchor")]
1566        #[unsafe(method(heightAnchor))]
1567        #[unsafe(method_family = none)]
1568        pub unsafe fn heightAnchor(&self) -> Retained<NSLayoutDimension>;
1569
1570        #[cfg(feature = "NSLayoutAnchor")]
1571        #[unsafe(method(centerXAnchor))]
1572        #[unsafe(method_family = none)]
1573        pub unsafe fn centerXAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1574
1575        #[cfg(feature = "NSLayoutAnchor")]
1576        #[unsafe(method(centerYAnchor))]
1577        #[unsafe(method_family = none)]
1578        pub unsafe fn centerYAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1579
1580        #[cfg(feature = "NSLayoutAnchor")]
1581        #[unsafe(method(firstBaselineAnchor))]
1582        #[unsafe(method_family = none)]
1583        pub unsafe fn firstBaselineAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1584
1585        #[cfg(feature = "NSLayoutAnchor")]
1586        #[unsafe(method(lastBaselineAnchor))]
1587        #[unsafe(method_family = none)]
1588        pub unsafe fn lastBaselineAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1589    );
1590}
1591
1592/// UIConstraintBasedLayoutDebugging.
1593#[cfg(feature = "UIResponder")]
1594impl UIView {
1595    extern_methods!(
1596        #[cfg(feature = "NSLayoutConstraint")]
1597        #[unsafe(method(constraintsAffectingLayoutForAxis:))]
1598        #[unsafe(method_family = none)]
1599        pub unsafe fn constraintsAffectingLayoutForAxis(
1600            &self,
1601            axis: UILayoutConstraintAxis,
1602        ) -> Retained<NSArray<NSLayoutConstraint>>;
1603
1604        #[unsafe(method(hasAmbiguousLayout))]
1605        #[unsafe(method_family = none)]
1606        pub unsafe fn hasAmbiguousLayout(&self) -> bool;
1607
1608        #[unsafe(method(exerciseAmbiguityInLayout))]
1609        #[unsafe(method_family = none)]
1610        pub unsafe fn exerciseAmbiguityInLayout(&self);
1611    );
1612}
1613
1614/// UIConstraintBasedLayoutDebugging.
1615#[cfg(feature = "UILayoutGuide")]
1616impl UILayoutGuide {
1617    extern_methods!(
1618        #[cfg(feature = "NSLayoutConstraint")]
1619        #[unsafe(method(constraintsAffectingLayoutForAxis:))]
1620        #[unsafe(method_family = none)]
1621        pub unsafe fn constraintsAffectingLayoutForAxis(
1622            &self,
1623            axis: UILayoutConstraintAxis,
1624        ) -> Retained<NSArray<NSLayoutConstraint>>;
1625
1626        #[unsafe(method(hasAmbiguousLayout))]
1627        #[unsafe(method_family = none)]
1628        pub unsafe fn hasAmbiguousLayout(&self) -> bool;
1629    );
1630}
1631
1632/// UIStateRestoration.
1633#[cfg(feature = "UIResponder")]
1634impl UIView {
1635    extern_methods!(
1636        #[unsafe(method(restorationIdentifier))]
1637        #[unsafe(method_family = none)]
1638        pub unsafe fn restorationIdentifier(&self) -> Option<Retained<NSString>>;
1639
1640        /// Setter for [`restorationIdentifier`][Self::restorationIdentifier].
1641        #[unsafe(method(setRestorationIdentifier:))]
1642        #[unsafe(method_family = none)]
1643        pub unsafe fn setRestorationIdentifier(&self, restoration_identifier: Option<&NSString>);
1644
1645        #[unsafe(method(encodeRestorableStateWithCoder:))]
1646        #[unsafe(method_family = none)]
1647        pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
1648
1649        #[unsafe(method(decodeRestorableStateWithCoder:))]
1650        #[unsafe(method_family = none)]
1651        pub unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);
1652    );
1653}
1654
1655/// UISnapshotting.
1656#[cfg(feature = "UIResponder")]
1657impl UIView {
1658    extern_methods!(
1659        #[unsafe(method(snapshotViewAfterScreenUpdates:))]
1660        #[unsafe(method_family = none)]
1661        pub unsafe fn snapshotViewAfterScreenUpdates(
1662            &self,
1663            after_updates: bool,
1664        ) -> Option<Retained<UIView>>;
1665
1666        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1667        #[unsafe(method(resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:))]
1668        #[unsafe(method_family = none)]
1669        pub unsafe fn resizableSnapshotViewFromRect_afterScreenUpdates_withCapInsets(
1670            &self,
1671            rect: CGRect,
1672            after_updates: bool,
1673            cap_insets: UIEdgeInsets,
1674        ) -> Option<Retained<UIView>>;
1675
1676        #[cfg(feature = "objc2-core-foundation")]
1677        #[unsafe(method(drawViewHierarchyInRect:afterScreenUpdates:))]
1678        #[unsafe(method_family = none)]
1679        pub unsafe fn drawViewHierarchyInRect_afterScreenUpdates(
1680            &self,
1681            rect: CGRect,
1682            after_updates: bool,
1683        ) -> bool;
1684    );
1685}
1686
1687/// DeprecatedAnimations.
1688#[cfg(feature = "UIResponder")]
1689impl UIView {
1690    extern_methods!(
1691        #[deprecated = "Use the block-based animation API instead"]
1692        #[unsafe(method(beginAnimations:context:))]
1693        #[unsafe(method_family = none)]
1694        pub unsafe fn beginAnimations_context(
1695            animation_id: Option<&NSString>,
1696            context: *mut c_void,
1697            mtm: MainThreadMarker,
1698        );
1699
1700        #[deprecated = "Use the block-based animation API instead"]
1701        #[unsafe(method(commitAnimations))]
1702        #[unsafe(method_family = none)]
1703        pub unsafe fn commitAnimations(mtm: MainThreadMarker);
1704
1705        #[deprecated = "Use the block-based animation API instead"]
1706        #[unsafe(method(setAnimationDelegate:))]
1707        #[unsafe(method_family = none)]
1708        pub unsafe fn setAnimationDelegate(delegate: Option<&AnyObject>, mtm: MainThreadMarker);
1709
1710        #[deprecated = "Use the block-based animation API instead"]
1711        #[unsafe(method(setAnimationWillStartSelector:))]
1712        #[unsafe(method_family = none)]
1713        pub unsafe fn setAnimationWillStartSelector(selector: Option<Sel>, mtm: MainThreadMarker);
1714
1715        #[deprecated = "Use the block-based animation API instead"]
1716        #[unsafe(method(setAnimationDidStopSelector:))]
1717        #[unsafe(method_family = none)]
1718        pub unsafe fn setAnimationDidStopSelector(selector: Option<Sel>, mtm: MainThreadMarker);
1719
1720        #[deprecated = "Use the block-based animation API instead"]
1721        #[unsafe(method(setAnimationDuration:))]
1722        #[unsafe(method_family = none)]
1723        pub unsafe fn setAnimationDuration(duration: NSTimeInterval, mtm: MainThreadMarker);
1724
1725        #[deprecated = "Use the block-based animation API instead"]
1726        #[unsafe(method(setAnimationDelay:))]
1727        #[unsafe(method_family = none)]
1728        pub unsafe fn setAnimationDelay(delay: NSTimeInterval, mtm: MainThreadMarker);
1729
1730        #[deprecated = "Use the block-based animation API instead"]
1731        #[unsafe(method(setAnimationStartDate:))]
1732        #[unsafe(method_family = none)]
1733        pub unsafe fn setAnimationStartDate(start_date: &NSDate, mtm: MainThreadMarker);
1734
1735        #[deprecated = "Use the block-based animation API instead"]
1736        #[unsafe(method(setAnimationCurve:))]
1737        #[unsafe(method_family = none)]
1738        pub unsafe fn setAnimationCurve(curve: UIViewAnimationCurve, mtm: MainThreadMarker);
1739
1740        #[deprecated = "Use the block-based animation API instead"]
1741        #[unsafe(method(setAnimationRepeatCount:))]
1742        #[unsafe(method_family = none)]
1743        pub unsafe fn setAnimationRepeatCount(repeat_count: c_float, mtm: MainThreadMarker);
1744
1745        #[deprecated = "Use the block-based animation API instead"]
1746        #[unsafe(method(setAnimationRepeatAutoreverses:))]
1747        #[unsafe(method_family = none)]
1748        pub unsafe fn setAnimationRepeatAutoreverses(
1749            repeat_autoreverses: bool,
1750            mtm: MainThreadMarker,
1751        );
1752
1753        #[deprecated = "Use the block-based animation API instead"]
1754        #[unsafe(method(setAnimationBeginsFromCurrentState:))]
1755        #[unsafe(method_family = none)]
1756        pub unsafe fn setAnimationBeginsFromCurrentState(
1757            from_current_state: bool,
1758            mtm: MainThreadMarker,
1759        );
1760
1761        #[deprecated = "Use the block-based animation API instead"]
1762        #[unsafe(method(setAnimationTransition:forView:cache:))]
1763        #[unsafe(method_family = none)]
1764        pub unsafe fn setAnimationTransition_forView_cache(
1765            transition: UIViewAnimationTransition,
1766            view: &UIView,
1767            cache: bool,
1768        );
1769    );
1770}
1771
1772/// UserInterfaceStyle.
1773#[cfg(feature = "UIResponder")]
1774impl UIView {
1775    extern_methods!(
1776        #[cfg(feature = "UIInterface")]
1777        #[unsafe(method(overrideUserInterfaceStyle))]
1778        #[unsafe(method_family = none)]
1779        pub unsafe fn overrideUserInterfaceStyle(&self) -> UIUserInterfaceStyle;
1780
1781        #[cfg(feature = "UIInterface")]
1782        /// Setter for [`overrideUserInterfaceStyle`][Self::overrideUserInterfaceStyle].
1783        #[unsafe(method(setOverrideUserInterfaceStyle:))]
1784        #[unsafe(method_family = none)]
1785        pub unsafe fn setOverrideUserInterfaceStyle(
1786            &self,
1787            override_user_interface_style: UIUserInterfaceStyle,
1788        );
1789    );
1790}
1791
1792/// UIContentSizeCategoryLimit.
1793#[cfg(feature = "UIResponder")]
1794impl UIView {
1795    extern_methods!(
1796        #[cfg(feature = "UIContentSizeCategory")]
1797        /// Specify content size category limits. Setting one or both of these properties will limit the
1798        /// content size category for this view (and its subviews) to a minimum or a maximum value.
1799        /// You can use this to limit the support content size categories on part of your view hierarchy.
1800        /// Setting this to nil removes the limit on the minimum or maximum.
1801        /// Limits will be applied immediately and when future content size category updates occur.
1802        ///
1803        /// Specifying a minimum limit that is greater than the maximum limit (or vice versa) will effectively
1804        /// only use the maximum limit.
1805        ///
1806        /// Example:
1807        ///
1808        /// // limit the support content size categories between .medium and .accessibilityExtraLarge (included).
1809        /// view.minimumContentSizeCategory = UIContentSizeCategoryMedium;
1810        /// view.maximumContentSizeCategory = UIContentSizeCategoryAccessibilityExtraLarge;
1811        #[unsafe(method(minimumContentSizeCategory))]
1812        #[unsafe(method_family = none)]
1813        pub unsafe fn minimumContentSizeCategory(&self) -> Option<Retained<UIContentSizeCategory>>;
1814
1815        #[cfg(feature = "UIContentSizeCategory")]
1816        /// Setter for [`minimumContentSizeCategory`][Self::minimumContentSizeCategory].
1817        #[unsafe(method(setMinimumContentSizeCategory:))]
1818        #[unsafe(method_family = none)]
1819        pub unsafe fn setMinimumContentSizeCategory(
1820            &self,
1821            minimum_content_size_category: Option<&UIContentSizeCategory>,
1822        );
1823
1824        #[cfg(feature = "UIContentSizeCategory")]
1825        #[unsafe(method(maximumContentSizeCategory))]
1826        #[unsafe(method_family = none)]
1827        pub unsafe fn maximumContentSizeCategory(&self) -> Option<Retained<UIContentSizeCategory>>;
1828
1829        #[cfg(feature = "UIContentSizeCategory")]
1830        /// Setter for [`maximumContentSizeCategory`][Self::maximumContentSizeCategory].
1831        #[unsafe(method(setMaximumContentSizeCategory:))]
1832        #[unsafe(method_family = none)]
1833        pub unsafe fn setMaximumContentSizeCategory(
1834            &self,
1835            maximum_content_size_category: Option<&UIContentSizeCategory>,
1836        );
1837
1838        /// Will return a string with a log of all the superviews of this view, alongside with what
1839        /// content size category each view has and if that view has limits applied.
1840        /// This is for debugging purposes only.
1841        #[unsafe(method(appliedContentSizeCategoryLimitsDescription))]
1842        #[unsafe(method_family = none)]
1843        pub unsafe fn appliedContentSizeCategoryLimitsDescription(&self) -> Retained<NSString>;
1844    );
1845}
1846
1847#[cfg(feature = "UIResponder")]
1848impl UIView {
1849    extern_methods!(
1850        #[cfg(feature = "UITraitCollection")]
1851        #[unsafe(method(traitOverrides))]
1852        #[unsafe(method_family = none)]
1853        pub unsafe fn traitOverrides(&self) -> Retained<ProtocolObject<dyn UITraitOverrides>>;
1854
1855        /// Forces an immediate trait update for this view (and its view controller, if applicable) and any subviews,
1856        /// including any view controllers or views in its subtree. Any trait change callbacks are sent synchronously.
1857        #[unsafe(method(updateTraitsIfNeeded))]
1858        #[unsafe(method_family = none)]
1859        pub unsafe fn updateTraitsIfNeeded(&self);
1860    );
1861}
1862
1863#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
1864extern_conformance!(
1865    unsafe impl UITraitChangeObservable for UIView {}
1866);