1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15#[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#[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#[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#[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#[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#[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#[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#[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#[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 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 #[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"))]
372unsafe impl CALayerDelegate for UIView {}
373
374#[cfg(feature = "UIResponder")]
375unsafe impl NSCoding for UIView {}
376
377#[cfg(feature = "UIResponder")]
378unsafe impl NSObjectProtocol for UIView {}
379
380#[cfg(all(feature = "UIAppearance", feature = "UIResponder"))]
381unsafe impl UIAppearance for UIView {}
382
383#[cfg(all(feature = "UIAppearance", feature = "UIResponder"))]
384unsafe impl UIAppearanceContainer for UIView {}
385
386#[cfg(feature = "UIResponder")]
387unsafe impl UICoordinateSpace for UIView {}
388
389#[cfg(all(feature = "UIDynamicBehavior", feature = "UIResponder"))]
390unsafe impl UIDynamicItem for UIView {}
391
392#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
393unsafe impl UIFocusEnvironment for UIView {}
394
395#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
396unsafe impl UIFocusItem for UIView {}
397
398#[cfg(all(feature = "UIFocus", feature = "UIResponder"))]
399unsafe impl UIFocusItemContainer for UIView {}
400
401#[cfg(feature = "UIResponder")]
402unsafe impl UIResponderStandardEditActions for UIView {}
403
404#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
405unsafe impl UITraitEnvironment for UIView {}
406
407#[cfg(feature = "UIResponder")]
408impl UIView {
409 extern_methods!(
410 #[unsafe(method(layerClass))]
411 #[unsafe(method_family = none)]
412 pub fn layerClass(mtm: MainThreadMarker) -> &'static AnyClass;
413
414 #[cfg(feature = "objc2-core-foundation")]
415 #[unsafe(method(initWithFrame:))]
416 #[unsafe(method_family = init)]
417 pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
418
419 #[unsafe(method(initWithCoder:))]
420 #[unsafe(method_family = init)]
421 pub unsafe fn initWithCoder(
422 this: Allocated<Self>,
423 coder: &NSCoder,
424 ) -> Option<Retained<Self>>;
425
426 #[unsafe(method(isUserInteractionEnabled))]
427 #[unsafe(method_family = none)]
428 pub unsafe fn isUserInteractionEnabled(&self) -> bool;
429
430 #[unsafe(method(setUserInteractionEnabled:))]
432 #[unsafe(method_family = none)]
433 pub unsafe fn setUserInteractionEnabled(&self, user_interaction_enabled: bool);
434
435 #[unsafe(method(tag))]
436 #[unsafe(method_family = none)]
437 pub unsafe fn tag(&self) -> NSInteger;
438
439 #[unsafe(method(setTag:))]
441 #[unsafe(method_family = none)]
442 pub unsafe fn setTag(&self, tag: NSInteger);
443
444 #[cfg(feature = "objc2-quartz-core")]
445 #[cfg(not(target_os = "watchos"))]
446 #[unsafe(method(layer))]
447 #[unsafe(method_family = none)]
448 pub fn layer(&self) -> Retained<CALayer>;
449
450 #[unsafe(method(canBecomeFocused))]
451 #[unsafe(method_family = none)]
452 pub unsafe fn canBecomeFocused(&self) -> bool;
453
454 #[unsafe(method(isFocused))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn isFocused(&self) -> bool;
457
458 #[unsafe(method(focusGroupIdentifier))]
460 #[unsafe(method_family = none)]
461 pub unsafe fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>;
462
463 #[unsafe(method(setFocusGroupIdentifier:))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn setFocusGroupIdentifier(&self, focus_group_identifier: Option<&NSString>);
467
468 #[cfg(feature = "UIFocus")]
469 #[unsafe(method(focusGroupPriority))]
472 #[unsafe(method_family = none)]
473 pub unsafe fn focusGroupPriority(&self) -> UIFocusGroupPriority;
474
475 #[cfg(feature = "UIFocus")]
476 #[unsafe(method(setFocusGroupPriority:))]
478 #[unsafe(method_family = none)]
479 pub unsafe fn setFocusGroupPriority(&self, focus_group_priority: UIFocusGroupPriority);
480
481 #[cfg(feature = "UIFocusEffect")]
482 #[unsafe(method(focusEffect))]
484 #[unsafe(method_family = none)]
485 pub unsafe fn focusEffect(&self) -> Option<Retained<UIFocusEffect>>;
486
487 #[cfg(feature = "UIFocusEffect")]
488 #[unsafe(method(setFocusEffect:))]
490 #[unsafe(method_family = none)]
491 pub unsafe fn setFocusEffect(&self, focus_effect: Option<&UIFocusEffect>);
492
493 #[unsafe(method(semanticContentAttribute))]
494 #[unsafe(method_family = none)]
495 pub unsafe fn semanticContentAttribute(&self) -> UISemanticContentAttribute;
496
497 #[unsafe(method(setSemanticContentAttribute:))]
499 #[unsafe(method_family = none)]
500 pub unsafe fn setSemanticContentAttribute(
501 &self,
502 semantic_content_attribute: UISemanticContentAttribute,
503 );
504
505 #[cfg(feature = "UIInterface")]
506 #[unsafe(method(userInterfaceLayoutDirectionForSemanticContentAttribute:))]
507 #[unsafe(method_family = none)]
508 pub unsafe fn userInterfaceLayoutDirectionForSemanticContentAttribute(
509 attribute: UISemanticContentAttribute,
510 mtm: MainThreadMarker,
511 ) -> UIUserInterfaceLayoutDirection;
512
513 #[cfg(feature = "UIInterface")]
514 #[unsafe(method(userInterfaceLayoutDirectionForSemanticContentAttribute:relativeToLayoutDirection:))]
515 #[unsafe(method_family = none)]
516 pub unsafe fn userInterfaceLayoutDirectionForSemanticContentAttribute_relativeToLayoutDirection(
517 semantic_content_attribute: UISemanticContentAttribute,
518 layout_direction: UIUserInterfaceLayoutDirection,
519 mtm: MainThreadMarker,
520 ) -> UIUserInterfaceLayoutDirection;
521
522 #[cfg(feature = "UIInterface")]
523 #[unsafe(method(effectiveUserInterfaceLayoutDirection))]
524 #[unsafe(method_family = none)]
525 pub unsafe fn effectiveUserInterfaceLayoutDirection(
526 &self,
527 ) -> UIUserInterfaceLayoutDirection;
528 );
529}
530
531#[cfg(feature = "UIResponder")]
533impl UIView {
534 extern_methods!(
535 #[unsafe(method(init))]
536 #[unsafe(method_family = init)]
537 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
538
539 #[unsafe(method(new))]
540 #[unsafe(method_family = new)]
541 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
542 );
543}
544
545#[cfg(feature = "UIResponder")]
547impl UIView {
548 extern_methods!(
549 #[cfg(feature = "objc2-core-foundation")]
550 #[unsafe(method(frame))]
551 #[unsafe(method_family = none)]
552 pub fn frame(&self) -> CGRect;
553
554 #[cfg(feature = "objc2-core-foundation")]
555 #[unsafe(method(setFrame:))]
557 #[unsafe(method_family = none)]
558 pub fn setFrame(&self, frame: CGRect);
559
560 #[cfg(feature = "objc2-core-foundation")]
561 #[unsafe(method(bounds))]
562 #[unsafe(method_family = none)]
563 pub fn bounds(&self) -> CGRect;
564
565 #[cfg(feature = "objc2-core-foundation")]
566 #[unsafe(method(setBounds:))]
568 #[unsafe(method_family = none)]
569 pub fn setBounds(&self, bounds: CGRect);
570
571 #[cfg(feature = "objc2-core-foundation")]
572 #[unsafe(method(center))]
573 #[unsafe(method_family = none)]
574 pub unsafe fn center(&self) -> CGPoint;
575
576 #[cfg(feature = "objc2-core-foundation")]
577 #[unsafe(method(setCenter:))]
579 #[unsafe(method_family = none)]
580 pub unsafe fn setCenter(&self, center: CGPoint);
581
582 #[cfg(feature = "objc2-core-foundation")]
583 #[unsafe(method(transform))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn transform(&self) -> CGAffineTransform;
586
587 #[cfg(feature = "objc2-core-foundation")]
588 #[unsafe(method(setTransform:))]
590 #[unsafe(method_family = none)]
591 pub unsafe fn setTransform(&self, transform: CGAffineTransform);
592
593 #[cfg(feature = "objc2-quartz-core")]
594 #[cfg(not(target_os = "watchos"))]
595 #[unsafe(method(transform3D))]
596 #[unsafe(method_family = none)]
597 pub unsafe fn transform3D(&self) -> CATransform3D;
598
599 #[cfg(feature = "objc2-quartz-core")]
600 #[cfg(not(target_os = "watchos"))]
601 #[unsafe(method(setTransform3D:))]
603 #[unsafe(method_family = none)]
604 pub unsafe fn setTransform3D(&self, transform3_d: CATransform3D);
605
606 #[cfg(feature = "objc2-core-foundation")]
607 #[unsafe(method(contentScaleFactor))]
608 #[unsafe(method_family = none)]
609 pub fn contentScaleFactor(&self) -> CGFloat;
610
611 #[cfg(feature = "objc2-core-foundation")]
612 #[unsafe(method(setContentScaleFactor:))]
614 #[unsafe(method_family = none)]
615 pub fn setContentScaleFactor(&self, content_scale_factor: CGFloat);
616
617 #[cfg(feature = "objc2-core-foundation")]
618 #[unsafe(method(anchorPoint))]
619 #[unsafe(method_family = none)]
620 pub unsafe fn anchorPoint(&self) -> CGPoint;
621
622 #[cfg(feature = "objc2-core-foundation")]
623 #[unsafe(method(setAnchorPoint:))]
625 #[unsafe(method_family = none)]
626 pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
627
628 #[unsafe(method(isMultipleTouchEnabled))]
629 #[unsafe(method_family = none)]
630 pub unsafe fn isMultipleTouchEnabled(&self) -> bool;
631
632 #[unsafe(method(setMultipleTouchEnabled:))]
634 #[unsafe(method_family = none)]
635 pub fn setMultipleTouchEnabled(&self, multiple_touch_enabled: bool);
636
637 #[unsafe(method(isExclusiveTouch))]
638 #[unsafe(method_family = none)]
639 pub unsafe fn isExclusiveTouch(&self) -> bool;
640
641 #[unsafe(method(setExclusiveTouch:))]
643 #[unsafe(method_family = none)]
644 pub unsafe fn setExclusiveTouch(&self, exclusive_touch: bool);
645
646 #[cfg(all(feature = "UIEvent", feature = "objc2-core-foundation"))]
647 #[unsafe(method(hitTest:withEvent:))]
648 #[unsafe(method_family = none)]
649 pub unsafe fn hitTest_withEvent(
650 &self,
651 point: CGPoint,
652 event: Option<&UIEvent>,
653 ) -> Option<Retained<UIView>>;
654
655 #[cfg(all(feature = "UIEvent", feature = "objc2-core-foundation"))]
656 #[unsafe(method(pointInside:withEvent:))]
657 #[unsafe(method_family = none)]
658 pub unsafe fn pointInside_withEvent(&self, point: CGPoint, event: Option<&UIEvent>)
659 -> bool;
660
661 #[cfg(feature = "objc2-core-foundation")]
662 #[unsafe(method(convertPoint:toView:))]
663 #[unsafe(method_family = none)]
664 pub unsafe fn convertPoint_toView(&self, point: CGPoint, view: Option<&UIView>) -> CGPoint;
665
666 #[cfg(feature = "objc2-core-foundation")]
667 #[unsafe(method(convertPoint:fromView:))]
668 #[unsafe(method_family = none)]
669 pub unsafe fn convertPoint_fromView(
670 &self,
671 point: CGPoint,
672 view: Option<&UIView>,
673 ) -> CGPoint;
674
675 #[cfg(feature = "objc2-core-foundation")]
676 #[unsafe(method(convertRect:toView:))]
677 #[unsafe(method_family = none)]
678 pub unsafe fn convertRect_toView(&self, rect: CGRect, view: Option<&UIView>) -> CGRect;
679
680 #[cfg(feature = "objc2-core-foundation")]
681 #[unsafe(method(convertRect:fromView:))]
682 #[unsafe(method_family = none)]
683 pub unsafe fn convertRect_fromView(&self, rect: CGRect, view: Option<&UIView>) -> CGRect;
684
685 #[unsafe(method(autoresizesSubviews))]
686 #[unsafe(method_family = none)]
687 pub unsafe fn autoresizesSubviews(&self) -> bool;
688
689 #[unsafe(method(setAutoresizesSubviews:))]
691 #[unsafe(method_family = none)]
692 pub unsafe fn setAutoresizesSubviews(&self, autoresizes_subviews: bool);
693
694 #[unsafe(method(autoresizingMask))]
695 #[unsafe(method_family = none)]
696 pub unsafe fn autoresizingMask(&self) -> UIViewAutoresizing;
697
698 #[unsafe(method(setAutoresizingMask:))]
700 #[unsafe(method_family = none)]
701 pub unsafe fn setAutoresizingMask(&self, autoresizing_mask: UIViewAutoresizing);
702
703 #[cfg(feature = "objc2-core-foundation")]
704 #[unsafe(method(sizeThatFits:))]
705 #[unsafe(method_family = none)]
706 pub unsafe fn sizeThatFits(&self, size: CGSize) -> CGSize;
707
708 #[unsafe(method(sizeToFit))]
709 #[unsafe(method_family = none)]
710 pub unsafe fn sizeToFit(&self);
711 );
712}
713
714#[cfg(feature = "UIResponder")]
716impl UIView {
717 extern_methods!(
718 #[unsafe(method(superview))]
719 #[unsafe(method_family = none)]
720 pub fn superview(&self) -> Option<Retained<UIView>>;
721
722 #[unsafe(method(subviews))]
723 #[unsafe(method_family = none)]
724 pub fn subviews(&self) -> Retained<NSArray<UIView>>;
725
726 #[cfg(feature = "UIWindow")]
727 #[unsafe(method(window))]
728 #[unsafe(method_family = none)]
729 pub fn window(&self) -> Option<Retained<UIWindow>>;
730
731 #[unsafe(method(removeFromSuperview))]
732 #[unsafe(method_family = none)]
733 pub unsafe fn removeFromSuperview(&self);
734
735 #[unsafe(method(insertSubview:atIndex:))]
736 #[unsafe(method_family = none)]
737 pub unsafe fn insertSubview_atIndex(&self, view: &UIView, index: NSInteger);
738
739 #[unsafe(method(exchangeSubviewAtIndex:withSubviewAtIndex:))]
740 #[unsafe(method_family = none)]
741 pub unsafe fn exchangeSubviewAtIndex_withSubviewAtIndex(
742 &self,
743 index1: NSInteger,
744 index2: NSInteger,
745 );
746
747 #[unsafe(method(addSubview:))]
748 #[unsafe(method_family = none)]
749 pub unsafe fn addSubview(&self, view: &UIView);
750
751 #[unsafe(method(insertSubview:belowSubview:))]
752 #[unsafe(method_family = none)]
753 pub unsafe fn insertSubview_belowSubview(&self, view: &UIView, sibling_subview: &UIView);
754
755 #[unsafe(method(insertSubview:aboveSubview:))]
756 #[unsafe(method_family = none)]
757 pub unsafe fn insertSubview_aboveSubview(&self, view: &UIView, sibling_subview: &UIView);
758
759 #[unsafe(method(bringSubviewToFront:))]
760 #[unsafe(method_family = none)]
761 pub unsafe fn bringSubviewToFront(&self, view: &UIView);
762
763 #[unsafe(method(sendSubviewToBack:))]
764 #[unsafe(method_family = none)]
765 pub unsafe fn sendSubviewToBack(&self, view: &UIView);
766
767 #[unsafe(method(didAddSubview:))]
768 #[unsafe(method_family = none)]
769 pub unsafe fn didAddSubview(&self, subview: &UIView);
770
771 #[unsafe(method(willRemoveSubview:))]
772 #[unsafe(method_family = none)]
773 pub unsafe fn willRemoveSubview(&self, subview: &UIView);
774
775 #[unsafe(method(willMoveToSuperview:))]
776 #[unsafe(method_family = none)]
777 pub unsafe fn willMoveToSuperview(&self, new_superview: Option<&UIView>);
778
779 #[unsafe(method(didMoveToSuperview))]
780 #[unsafe(method_family = none)]
781 pub unsafe fn didMoveToSuperview(&self);
782
783 #[cfg(feature = "UIWindow")]
784 #[unsafe(method(willMoveToWindow:))]
785 #[unsafe(method_family = none)]
786 pub unsafe fn willMoveToWindow(&self, new_window: Option<&UIWindow>);
787
788 #[unsafe(method(didMoveToWindow))]
789 #[unsafe(method_family = none)]
790 pub unsafe fn didMoveToWindow(&self);
791
792 #[unsafe(method(isDescendantOfView:))]
793 #[unsafe(method_family = none)]
794 pub unsafe fn isDescendantOfView(&self, view: &UIView) -> bool;
795
796 #[unsafe(method(viewWithTag:))]
797 #[unsafe(method_family = none)]
798 pub unsafe fn viewWithTag(&self, tag: NSInteger) -> Option<Retained<UIView>>;
799
800 #[unsafe(method(setNeedsLayout))]
801 #[unsafe(method_family = none)]
802 pub unsafe fn setNeedsLayout(&self);
803
804 #[unsafe(method(layoutIfNeeded))]
805 #[unsafe(method_family = none)]
806 pub unsafe fn layoutIfNeeded(&self);
807
808 #[unsafe(method(layoutSubviews))]
809 #[unsafe(method_family = none)]
810 pub unsafe fn layoutSubviews(&self);
811
812 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
813 #[unsafe(method(layoutMargins))]
814 #[unsafe(method_family = none)]
815 pub unsafe fn layoutMargins(&self) -> UIEdgeInsets;
816
817 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
818 #[unsafe(method(setLayoutMargins:))]
820 #[unsafe(method_family = none)]
821 pub unsafe fn setLayoutMargins(&self, layout_margins: UIEdgeInsets);
822
823 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
824 #[unsafe(method(directionalLayoutMargins))]
825 #[unsafe(method_family = none)]
826 pub unsafe fn directionalLayoutMargins(&self) -> NSDirectionalEdgeInsets;
827
828 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
829 #[unsafe(method(setDirectionalLayoutMargins:))]
831 #[unsafe(method_family = none)]
832 pub unsafe fn setDirectionalLayoutMargins(
833 &self,
834 directional_layout_margins: NSDirectionalEdgeInsets,
835 );
836
837 #[unsafe(method(preservesSuperviewLayoutMargins))]
838 #[unsafe(method_family = none)]
839 pub unsafe fn preservesSuperviewLayoutMargins(&self) -> bool;
840
841 #[unsafe(method(setPreservesSuperviewLayoutMargins:))]
843 #[unsafe(method_family = none)]
844 pub unsafe fn setPreservesSuperviewLayoutMargins(
845 &self,
846 preserves_superview_layout_margins: bool,
847 );
848
849 #[unsafe(method(insetsLayoutMarginsFromSafeArea))]
850 #[unsafe(method_family = none)]
851 pub unsafe fn insetsLayoutMarginsFromSafeArea(&self) -> bool;
852
853 #[unsafe(method(setInsetsLayoutMarginsFromSafeArea:))]
855 #[unsafe(method_family = none)]
856 pub unsafe fn setInsetsLayoutMarginsFromSafeArea(
857 &self,
858 insets_layout_margins_from_safe_area: bool,
859 );
860
861 #[unsafe(method(layoutMarginsDidChange))]
862 #[unsafe(method_family = none)]
863 pub unsafe fn layoutMarginsDidChange(&self);
864
865 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
866 #[unsafe(method(safeAreaInsets))]
867 #[unsafe(method_family = none)]
868 pub fn safeAreaInsets(&self) -> UIEdgeInsets;
869
870 #[unsafe(method(safeAreaInsetsDidChange))]
871 #[unsafe(method_family = none)]
872 pub unsafe fn safeAreaInsetsDidChange(&self);
873
874 #[cfg(feature = "UILayoutGuide")]
875 #[unsafe(method(layoutMarginsGuide))]
876 #[unsafe(method_family = none)]
877 pub unsafe fn layoutMarginsGuide(&self) -> Retained<UILayoutGuide>;
878
879 #[cfg(feature = "UILayoutGuide")]
880 #[unsafe(method(readableContentGuide))]
882 #[unsafe(method_family = none)]
883 pub unsafe fn readableContentGuide(&self) -> Retained<UILayoutGuide>;
884
885 #[cfg(feature = "UILayoutGuide")]
886 #[unsafe(method(safeAreaLayoutGuide))]
887 #[unsafe(method_family = none)]
888 pub unsafe fn safeAreaLayoutGuide(&self) -> Retained<UILayoutGuide>;
889
890 #[cfg(all(
891 feature = "UIKeyboardLayoutGuide",
892 feature = "UILayoutGuide",
893 feature = "UITrackingLayoutGuide"
894 ))]
895 #[unsafe(method(keyboardLayoutGuide))]
897 #[unsafe(method_family = none)]
898 pub unsafe fn keyboardLayoutGuide(&self) -> Retained<UIKeyboardLayoutGuide>;
899 );
900}
901
902#[cfg(feature = "UIResponder")]
904impl UIView {
905 extern_methods!(
906 #[cfg(feature = "objc2-core-foundation")]
907 #[unsafe(method(drawRect:))]
908 #[unsafe(method_family = none)]
909 pub unsafe fn drawRect(&self, rect: CGRect);
910
911 #[unsafe(method(setNeedsDisplay))]
912 #[unsafe(method_family = none)]
913 pub fn setNeedsDisplay(&self);
914
915 #[cfg(feature = "objc2-core-foundation")]
916 #[unsafe(method(setNeedsDisplayInRect:))]
917 #[unsafe(method_family = none)]
918 pub unsafe fn setNeedsDisplayInRect(&self, rect: CGRect);
919
920 #[unsafe(method(clipsToBounds))]
921 #[unsafe(method_family = none)]
922 pub unsafe fn clipsToBounds(&self) -> bool;
923
924 #[unsafe(method(setClipsToBounds:))]
926 #[unsafe(method_family = none)]
927 pub unsafe fn setClipsToBounds(&self, clips_to_bounds: bool);
928
929 #[cfg(feature = "UIColor")]
930 #[unsafe(method(backgroundColor))]
931 #[unsafe(method_family = none)]
932 pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
933
934 #[cfg(feature = "UIColor")]
935 #[unsafe(method(setBackgroundColor:))]
937 #[unsafe(method_family = none)]
938 pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
939
940 #[cfg(feature = "objc2-core-foundation")]
941 #[unsafe(method(alpha))]
942 #[unsafe(method_family = none)]
943 pub unsafe fn alpha(&self) -> CGFloat;
944
945 #[cfg(feature = "objc2-core-foundation")]
946 #[unsafe(method(setAlpha:))]
948 #[unsafe(method_family = none)]
949 pub unsafe fn setAlpha(&self, alpha: CGFloat);
950
951 #[unsafe(method(isOpaque))]
952 #[unsafe(method_family = none)]
953 pub unsafe fn isOpaque(&self) -> bool;
954
955 #[unsafe(method(setOpaque:))]
957 #[unsafe(method_family = none)]
958 pub unsafe fn setOpaque(&self, opaque: bool);
959
960 #[unsafe(method(clearsContextBeforeDrawing))]
961 #[unsafe(method_family = none)]
962 pub unsafe fn clearsContextBeforeDrawing(&self) -> bool;
963
964 #[unsafe(method(setClearsContextBeforeDrawing:))]
966 #[unsafe(method_family = none)]
967 pub unsafe fn setClearsContextBeforeDrawing(&self, clears_context_before_drawing: bool);
968
969 #[unsafe(method(isHidden))]
970 #[unsafe(method_family = none)]
971 pub fn isHidden(&self) -> bool;
972
973 #[unsafe(method(setHidden:))]
975 #[unsafe(method_family = none)]
976 pub fn setHidden(&self, hidden: bool);
977
978 #[unsafe(method(contentMode))]
979 #[unsafe(method_family = none)]
980 pub unsafe fn contentMode(&self) -> UIViewContentMode;
981
982 #[unsafe(method(setContentMode:))]
984 #[unsafe(method_family = none)]
985 pub unsafe fn setContentMode(&self, content_mode: UIViewContentMode);
986
987 #[cfg(feature = "objc2-core-foundation")]
988 #[deprecated]
989 #[unsafe(method(contentStretch))]
990 #[unsafe(method_family = none)]
991 pub unsafe fn contentStretch(&self) -> CGRect;
992
993 #[cfg(feature = "objc2-core-foundation")]
994 #[deprecated]
996 #[unsafe(method(setContentStretch:))]
997 #[unsafe(method_family = none)]
998 pub unsafe fn setContentStretch(&self, content_stretch: CGRect);
999
1000 #[unsafe(method(maskView))]
1001 #[unsafe(method_family = none)]
1002 pub unsafe fn maskView(&self) -> Option<Retained<UIView>>;
1003
1004 #[unsafe(method(setMaskView:))]
1006 #[unsafe(method_family = none)]
1007 pub unsafe fn setMaskView(&self, mask_view: Option<&UIView>);
1008
1009 #[cfg(feature = "UIColor")]
1010 #[unsafe(method(tintColor))]
1011 #[unsafe(method_family = none)]
1012 pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
1013
1014 #[cfg(feature = "UIColor")]
1015 #[unsafe(method(setTintColor:))]
1017 #[unsafe(method_family = none)]
1018 pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
1019
1020 #[unsafe(method(tintAdjustmentMode))]
1021 #[unsafe(method_family = none)]
1022 pub unsafe fn tintAdjustmentMode(&self) -> UIViewTintAdjustmentMode;
1023
1024 #[unsafe(method(setTintAdjustmentMode:))]
1026 #[unsafe(method_family = none)]
1027 pub unsafe fn setTintAdjustmentMode(&self, tint_adjustment_mode: UIViewTintAdjustmentMode);
1028
1029 #[unsafe(method(tintColorDidChange))]
1030 #[unsafe(method_family = none)]
1031 pub unsafe fn tintColorDidChange(&self);
1032 );
1033}
1034
1035#[cfg(feature = "UIResponder")]
1037impl UIView {
1038 extern_methods!(
1039 #[unsafe(method(setAnimationsEnabled:))]
1040 #[unsafe(method_family = none)]
1041 pub unsafe fn setAnimationsEnabled(enabled: bool, mtm: MainThreadMarker);
1042
1043 #[unsafe(method(areAnimationsEnabled))]
1044 #[unsafe(method_family = none)]
1045 pub unsafe fn areAnimationsEnabled(mtm: MainThreadMarker) -> bool;
1046
1047 #[cfg(feature = "block2")]
1048 #[unsafe(method(performWithoutAnimation:))]
1049 #[unsafe(method_family = none)]
1050 pub unsafe fn performWithoutAnimation(
1051 actions_without_animation: &block2::Block<dyn Fn() + '_>,
1052 mtm: MainThreadMarker,
1053 );
1054
1055 #[unsafe(method(inheritedAnimationDuration))]
1056 #[unsafe(method_family = none)]
1057 pub unsafe fn inheritedAnimationDuration(mtm: MainThreadMarker) -> NSTimeInterval;
1058 );
1059}
1060
1061#[cfg(feature = "UIResponder")]
1063impl UIView {
1064 extern_methods!(
1065 #[cfg(feature = "block2")]
1066 #[unsafe(method(animateWithDuration:delay:options:animations:completion:))]
1067 #[unsafe(method_family = none)]
1068 pub unsafe fn animateWithDuration_delay_options_animations_completion(
1069 duration: NSTimeInterval,
1070 delay: NSTimeInterval,
1071 options: UIViewAnimationOptions,
1072 animations: &block2::Block<dyn Fn()>,
1073 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1074 mtm: MainThreadMarker,
1075 );
1076
1077 #[cfg(feature = "block2")]
1078 #[unsafe(method(animateWithDuration:animations:completion:))]
1079 #[unsafe(method_family = none)]
1080 pub unsafe fn animateWithDuration_animations_completion(
1081 duration: NSTimeInterval,
1082 animations: &block2::Block<dyn Fn()>,
1083 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1084 mtm: MainThreadMarker,
1085 );
1086
1087 #[cfg(feature = "block2")]
1088 #[unsafe(method(animateWithDuration:animations:))]
1089 #[unsafe(method_family = none)]
1090 pub unsafe fn animateWithDuration_animations(
1091 duration: NSTimeInterval,
1092 animations: &block2::Block<dyn Fn()>,
1093 mtm: MainThreadMarker,
1094 );
1095
1096 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
1097 #[unsafe(method(animateWithSpringDuration:bounce:initialSpringVelocity:delay:options:animations:completion:))]
1098 #[unsafe(method_family = none)]
1099 pub unsafe fn animateWithSpringDuration_bounce_initialSpringVelocity_delay_options_animations_completion(
1100 duration: NSTimeInterval,
1101 bounce: CGFloat,
1102 velocity: CGFloat,
1103 delay: NSTimeInterval,
1104 options: UIViewAnimationOptions,
1105 animations: &block2::Block<dyn Fn() + '_>,
1106 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1107 mtm: MainThreadMarker,
1108 );
1109
1110 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
1111 #[unsafe(method(animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:))]
1112 #[unsafe(method_family = none)]
1113 pub unsafe fn animateWithDuration_delay_usingSpringWithDamping_initialSpringVelocity_options_animations_completion(
1114 duration: NSTimeInterval,
1115 delay: NSTimeInterval,
1116 damping_ratio: CGFloat,
1117 velocity: CGFloat,
1118 options: UIViewAnimationOptions,
1119 animations: &block2::Block<dyn Fn()>,
1120 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1121 mtm: MainThreadMarker,
1122 );
1123
1124 #[cfg(feature = "block2")]
1125 #[unsafe(method(transitionWithView:duration:options:animations:completion:))]
1126 #[unsafe(method_family = none)]
1127 pub unsafe fn transitionWithView_duration_options_animations_completion(
1128 view: &UIView,
1129 duration: NSTimeInterval,
1130 options: UIViewAnimationOptions,
1131 animations: Option<&block2::Block<dyn Fn()>>,
1132 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1133 );
1134
1135 #[cfg(feature = "block2")]
1136 #[unsafe(method(transitionFromView:toView:duration:options:completion:))]
1137 #[unsafe(method_family = none)]
1138 pub unsafe fn transitionFromView_toView_duration_options_completion(
1139 from_view: &UIView,
1140 to_view: &UIView,
1141 duration: NSTimeInterval,
1142 options: UIViewAnimationOptions,
1143 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1144 );
1145
1146 #[cfg(feature = "block2")]
1147 #[unsafe(method(performSystemAnimation:onViews:options:animations:completion:))]
1148 #[unsafe(method_family = none)]
1149 pub unsafe fn performSystemAnimation_onViews_options_animations_completion(
1150 animation: UISystemAnimation,
1151 views: &NSArray<UIView>,
1152 options: UIViewAnimationOptions,
1153 parallel_animations: Option<&block2::Block<dyn Fn()>>,
1154 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1155 mtm: MainThreadMarker,
1156 );
1157
1158 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
1159 #[unsafe(method(modifyAnimationsWithRepeatCount:autoreverses:animations:))]
1160 #[unsafe(method_family = none)]
1161 pub unsafe fn modifyAnimationsWithRepeatCount_autoreverses_animations(
1162 count: CGFloat,
1163 autoreverses: bool,
1164 animations: &block2::Block<dyn Fn() + '_>,
1165 mtm: MainThreadMarker,
1166 );
1167 );
1168}
1169
1170#[cfg(feature = "UIResponder")]
1172impl UIView {
1173 extern_methods!(
1174 #[cfg(feature = "block2")]
1175 #[unsafe(method(animateKeyframesWithDuration:delay:options:animations:completion:))]
1176 #[unsafe(method_family = none)]
1177 pub unsafe fn animateKeyframesWithDuration_delay_options_animations_completion(
1178 duration: NSTimeInterval,
1179 delay: NSTimeInterval,
1180 options: UIViewKeyframeAnimationOptions,
1181 animations: &block2::Block<dyn Fn()>,
1182 completion: Option<&block2::Block<dyn Fn(Bool)>>,
1183 mtm: MainThreadMarker,
1184 );
1185
1186 #[cfg(feature = "block2")]
1187 #[unsafe(method(addKeyframeWithRelativeStartTime:relativeDuration:animations:))]
1188 #[unsafe(method_family = none)]
1189 pub unsafe fn addKeyframeWithRelativeStartTime_relativeDuration_animations(
1190 frame_start_time: c_double,
1191 frame_duration: c_double,
1192 animations: &block2::Block<dyn Fn()>,
1193 mtm: MainThreadMarker,
1194 );
1195 );
1196}
1197
1198#[cfg(feature = "UIResponder")]
1200impl UIView {
1201 extern_methods!(
1202 #[cfg(feature = "UIGestureRecognizer")]
1203 #[unsafe(method(gestureRecognizers))]
1204 #[unsafe(method_family = none)]
1205 pub fn gestureRecognizers(&self) -> Option<Retained<NSArray<UIGestureRecognizer>>>;
1206
1207 #[cfg(feature = "UIGestureRecognizer")]
1208 #[unsafe(method(setGestureRecognizers:))]
1210 #[unsafe(method_family = none)]
1211 pub unsafe fn setGestureRecognizers(
1212 &self,
1213 gesture_recognizers: Option<&NSArray<UIGestureRecognizer>>,
1214 );
1215
1216 #[cfg(feature = "UIGestureRecognizer")]
1217 #[unsafe(method(addGestureRecognizer:))]
1218 #[unsafe(method_family = none)]
1219 pub fn addGestureRecognizer(&self, gesture_recognizer: &UIGestureRecognizer);
1220
1221 #[cfg(feature = "UIGestureRecognizer")]
1222 #[unsafe(method(removeGestureRecognizer:))]
1223 #[unsafe(method_family = none)]
1224 pub fn removeGestureRecognizer(&self, gesture_recognizer: &UIGestureRecognizer);
1225
1226 #[cfg(feature = "UIGestureRecognizer")]
1227 #[unsafe(method(gestureRecognizerShouldBegin:))]
1228 #[unsafe(method_family = none)]
1229 pub fn gestureRecognizerShouldBegin(
1230 &self,
1231 gesture_recognizer: &UIGestureRecognizer,
1232 ) -> bool;
1233 );
1234}
1235
1236#[cfg(feature = "UIResponder")]
1238impl UIView {
1239 extern_methods!(
1240 #[cfg(feature = "UIMotionEffect")]
1241 #[unsafe(method(addMotionEffect:))]
1247 #[unsafe(method_family = none)]
1248 pub unsafe fn addMotionEffect(&self, effect: &UIMotionEffect);
1249
1250 #[cfg(feature = "UIMotionEffect")]
1251 #[unsafe(method(removeMotionEffect:))]
1254 #[unsafe(method_family = none)]
1255 pub unsafe fn removeMotionEffect(&self, effect: &UIMotionEffect);
1256
1257 #[cfg(feature = "UIMotionEffect")]
1258 #[unsafe(method(motionEffects))]
1259 #[unsafe(method_family = none)]
1260 pub unsafe fn motionEffects(&self) -> Retained<NSArray<UIMotionEffect>>;
1261
1262 #[cfg(feature = "UIMotionEffect")]
1263 #[unsafe(method(setMotionEffects:))]
1265 #[unsafe(method_family = none)]
1266 pub unsafe fn setMotionEffects(&self, motion_effects: &NSArray<UIMotionEffect>);
1267 );
1268}
1269
1270#[repr(transparent)]
1273#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1274pub struct UILayoutConstraintAxis(pub NSInteger);
1275impl UILayoutConstraintAxis {
1276 #[doc(alias = "UILayoutConstraintAxisHorizontal")]
1277 pub const Horizontal: Self = Self(0);
1278 #[doc(alias = "UILayoutConstraintAxisVertical")]
1279 pub const Vertical: Self = Self(1);
1280}
1281
1282unsafe impl Encode for UILayoutConstraintAxis {
1283 const ENCODING: Encoding = NSInteger::ENCODING;
1284}
1285
1286unsafe impl RefEncode for UILayoutConstraintAxis {
1287 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1288}
1289
1290#[cfg(feature = "UIResponder")]
1292impl UIView {
1293 extern_methods!(
1294 #[cfg(feature = "NSLayoutConstraint")]
1295 #[unsafe(method(constraints))]
1296 #[unsafe(method_family = none)]
1297 pub unsafe fn constraints(&self) -> Retained<NSArray<NSLayoutConstraint>>;
1298
1299 #[cfg(feature = "NSLayoutConstraint")]
1300 #[unsafe(method(addConstraint:))]
1301 #[unsafe(method_family = none)]
1302 pub unsafe fn addConstraint(&self, constraint: &NSLayoutConstraint);
1303
1304 #[cfg(feature = "NSLayoutConstraint")]
1305 #[unsafe(method(addConstraints:))]
1306 #[unsafe(method_family = none)]
1307 pub unsafe fn addConstraints(&self, constraints: &NSArray<NSLayoutConstraint>);
1308
1309 #[cfg(feature = "NSLayoutConstraint")]
1310 #[unsafe(method(removeConstraint:))]
1311 #[unsafe(method_family = none)]
1312 pub unsafe fn removeConstraint(&self, constraint: &NSLayoutConstraint);
1313
1314 #[cfg(feature = "NSLayoutConstraint")]
1315 #[unsafe(method(removeConstraints:))]
1316 #[unsafe(method_family = none)]
1317 pub unsafe fn removeConstraints(&self, constraints: &NSArray<NSLayoutConstraint>);
1318 );
1319}
1320
1321#[cfg(feature = "UIResponder")]
1323impl UIView {
1324 extern_methods!(
1325 #[unsafe(method(updateConstraintsIfNeeded))]
1326 #[unsafe(method_family = none)]
1327 pub unsafe fn updateConstraintsIfNeeded(&self);
1328
1329 #[unsafe(method(updateConstraints))]
1330 #[unsafe(method_family = none)]
1331 pub unsafe fn updateConstraints(&self);
1332
1333 #[unsafe(method(needsUpdateConstraints))]
1334 #[unsafe(method_family = none)]
1335 pub unsafe fn needsUpdateConstraints(&self) -> bool;
1336
1337 #[unsafe(method(setNeedsUpdateConstraints))]
1338 #[unsafe(method_family = none)]
1339 pub unsafe fn setNeedsUpdateConstraints(&self);
1340 );
1341}
1342
1343#[cfg(feature = "UIResponder")]
1345impl UIView {
1346 extern_methods!(
1347 #[unsafe(method(translatesAutoresizingMaskIntoConstraints))]
1348 #[unsafe(method_family = none)]
1349 pub unsafe fn translatesAutoresizingMaskIntoConstraints(&self) -> bool;
1350
1351 #[unsafe(method(setTranslatesAutoresizingMaskIntoConstraints:))]
1353 #[unsafe(method_family = none)]
1354 pub unsafe fn setTranslatesAutoresizingMaskIntoConstraints(
1355 &self,
1356 translates_autoresizing_mask_into_constraints: bool,
1357 );
1358
1359 #[unsafe(method(requiresConstraintBasedLayout))]
1360 #[unsafe(method_family = none)]
1361 pub unsafe fn requiresConstraintBasedLayout(mtm: MainThreadMarker) -> bool;
1362 );
1363}
1364
1365extern "C" {
1366 #[cfg(feature = "objc2-core-foundation")]
1368 pub static UIViewNoIntrinsicMetric: CGFloat;
1369}
1370
1371#[cfg(feature = "UIResponder")]
1373impl UIView {
1374 extern_methods!(
1375 #[cfg(feature = "objc2-core-foundation")]
1376 #[unsafe(method(alignmentRectForFrame:))]
1377 #[unsafe(method_family = none)]
1378 pub unsafe fn alignmentRectForFrame(&self, frame: CGRect) -> CGRect;
1379
1380 #[cfg(feature = "objc2-core-foundation")]
1381 #[unsafe(method(frameForAlignmentRect:))]
1382 #[unsafe(method_family = none)]
1383 pub unsafe fn frameForAlignmentRect(&self, alignment_rect: CGRect) -> CGRect;
1384
1385 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1386 #[unsafe(method(alignmentRectInsets))]
1387 #[unsafe(method_family = none)]
1388 pub unsafe fn alignmentRectInsets(&self) -> UIEdgeInsets;
1389
1390 #[deprecated = "Override -viewForFirstBaselineLayout or -viewForLastBaselineLayout as appropriate, instead"]
1391 #[unsafe(method(viewForBaselineLayout))]
1392 #[unsafe(method_family = none)]
1393 pub unsafe fn viewForBaselineLayout(&self) -> Retained<UIView>;
1394
1395 #[unsafe(method(viewForFirstBaselineLayout))]
1396 #[unsafe(method_family = none)]
1397 pub unsafe fn viewForFirstBaselineLayout(&self) -> Retained<UIView>;
1398
1399 #[unsafe(method(viewForLastBaselineLayout))]
1400 #[unsafe(method_family = none)]
1401 pub unsafe fn viewForLastBaselineLayout(&self) -> Retained<UIView>;
1402
1403 #[cfg(feature = "objc2-core-foundation")]
1404 #[unsafe(method(intrinsicContentSize))]
1405 #[unsafe(method_family = none)]
1406 pub unsafe fn intrinsicContentSize(&self) -> CGSize;
1407
1408 #[unsafe(method(invalidateIntrinsicContentSize))]
1409 #[unsafe(method_family = none)]
1410 pub unsafe fn invalidateIntrinsicContentSize(&self);
1411
1412 #[cfg(feature = "NSLayoutConstraint")]
1413 #[unsafe(method(contentHuggingPriorityForAxis:))]
1414 #[unsafe(method_family = none)]
1415 pub unsafe fn contentHuggingPriorityForAxis(
1416 &self,
1417 axis: UILayoutConstraintAxis,
1418 ) -> UILayoutPriority;
1419
1420 #[cfg(feature = "NSLayoutConstraint")]
1421 #[unsafe(method(setContentHuggingPriority:forAxis:))]
1422 #[unsafe(method_family = none)]
1423 pub unsafe fn setContentHuggingPriority_forAxis(
1424 &self,
1425 priority: UILayoutPriority,
1426 axis: UILayoutConstraintAxis,
1427 );
1428
1429 #[cfg(feature = "NSLayoutConstraint")]
1430 #[unsafe(method(contentCompressionResistancePriorityForAxis:))]
1431 #[unsafe(method_family = none)]
1432 pub unsafe fn contentCompressionResistancePriorityForAxis(
1433 &self,
1434 axis: UILayoutConstraintAxis,
1435 ) -> UILayoutPriority;
1436
1437 #[cfg(feature = "NSLayoutConstraint")]
1438 #[unsafe(method(setContentCompressionResistancePriority:forAxis:))]
1439 #[unsafe(method_family = none)]
1440 pub unsafe fn setContentCompressionResistancePriority_forAxis(
1441 &self,
1442 priority: UILayoutPriority,
1443 axis: UILayoutConstraintAxis,
1444 );
1445 );
1446}
1447
1448extern "C" {
1449 #[cfg(feature = "objc2-core-foundation")]
1451 pub static UILayoutFittingCompressedSize: CGSize;
1452}
1453
1454extern "C" {
1455 #[cfg(feature = "objc2-core-foundation")]
1457 pub static UILayoutFittingExpandedSize: CGSize;
1458}
1459
1460#[cfg(feature = "UIResponder")]
1462impl UIView {
1463 extern_methods!(
1464 #[cfg(feature = "objc2-core-foundation")]
1465 #[unsafe(method(systemLayoutSizeFittingSize:))]
1466 #[unsafe(method_family = none)]
1467 pub unsafe fn systemLayoutSizeFittingSize(&self, target_size: CGSize) -> CGSize;
1468
1469 #[cfg(all(feature = "NSLayoutConstraint", feature = "objc2-core-foundation"))]
1470 #[unsafe(method(systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:))]
1471 #[unsafe(method_family = none)]
1472 pub unsafe fn systemLayoutSizeFittingSize_withHorizontalFittingPriority_verticalFittingPriority(
1473 &self,
1474 target_size: CGSize,
1475 horizontal_fitting_priority: UILayoutPriority,
1476 vertical_fitting_priority: UILayoutPriority,
1477 ) -> CGSize;
1478 );
1479}
1480
1481#[cfg(feature = "UIResponder")]
1483impl UIView {
1484 extern_methods!(
1485 #[cfg(feature = "UILayoutGuide")]
1486 #[unsafe(method(layoutGuides))]
1487 #[unsafe(method_family = none)]
1488 pub unsafe fn layoutGuides(&self) -> Retained<NSArray<UILayoutGuide>>;
1489
1490 #[cfg(feature = "UILayoutGuide")]
1491 #[unsafe(method(addLayoutGuide:))]
1492 #[unsafe(method_family = none)]
1493 pub unsafe fn addLayoutGuide(&self, layout_guide: &UILayoutGuide);
1494
1495 #[cfg(feature = "UILayoutGuide")]
1496 #[unsafe(method(removeLayoutGuide:))]
1497 #[unsafe(method_family = none)]
1498 pub unsafe fn removeLayoutGuide(&self, layout_guide: &UILayoutGuide);
1499 );
1500}
1501
1502#[cfg(feature = "UIResponder")]
1504impl UIView {
1505 extern_methods!(
1506 #[cfg(feature = "NSLayoutAnchor")]
1507 #[unsafe(method(leadingAnchor))]
1508 #[unsafe(method_family = none)]
1509 pub unsafe fn leadingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1510
1511 #[cfg(feature = "NSLayoutAnchor")]
1512 #[unsafe(method(trailingAnchor))]
1513 #[unsafe(method_family = none)]
1514 pub unsafe fn trailingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1515
1516 #[cfg(feature = "NSLayoutAnchor")]
1517 #[unsafe(method(leftAnchor))]
1518 #[unsafe(method_family = none)]
1519 pub unsafe fn leftAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1520
1521 #[cfg(feature = "NSLayoutAnchor")]
1522 #[unsafe(method(rightAnchor))]
1523 #[unsafe(method_family = none)]
1524 pub unsafe fn rightAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1525
1526 #[cfg(feature = "NSLayoutAnchor")]
1527 #[unsafe(method(topAnchor))]
1528 #[unsafe(method_family = none)]
1529 pub unsafe fn topAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1530
1531 #[cfg(feature = "NSLayoutAnchor")]
1532 #[unsafe(method(bottomAnchor))]
1533 #[unsafe(method_family = none)]
1534 pub unsafe fn bottomAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1535
1536 #[cfg(feature = "NSLayoutAnchor")]
1537 #[unsafe(method(widthAnchor))]
1538 #[unsafe(method_family = none)]
1539 pub unsafe fn widthAnchor(&self) -> Retained<NSLayoutDimension>;
1540
1541 #[cfg(feature = "NSLayoutAnchor")]
1542 #[unsafe(method(heightAnchor))]
1543 #[unsafe(method_family = none)]
1544 pub unsafe fn heightAnchor(&self) -> Retained<NSLayoutDimension>;
1545
1546 #[cfg(feature = "NSLayoutAnchor")]
1547 #[unsafe(method(centerXAnchor))]
1548 #[unsafe(method_family = none)]
1549 pub unsafe fn centerXAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
1550
1551 #[cfg(feature = "NSLayoutAnchor")]
1552 #[unsafe(method(centerYAnchor))]
1553 #[unsafe(method_family = none)]
1554 pub unsafe fn centerYAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1555
1556 #[cfg(feature = "NSLayoutAnchor")]
1557 #[unsafe(method(firstBaselineAnchor))]
1558 #[unsafe(method_family = none)]
1559 pub unsafe fn firstBaselineAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1560
1561 #[cfg(feature = "NSLayoutAnchor")]
1562 #[unsafe(method(lastBaselineAnchor))]
1563 #[unsafe(method_family = none)]
1564 pub unsafe fn lastBaselineAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
1565 );
1566}
1567
1568#[cfg(feature = "UIResponder")]
1570impl UIView {
1571 extern_methods!(
1572 #[cfg(feature = "NSLayoutConstraint")]
1573 #[unsafe(method(constraintsAffectingLayoutForAxis:))]
1574 #[unsafe(method_family = none)]
1575 pub unsafe fn constraintsAffectingLayoutForAxis(
1576 &self,
1577 axis: UILayoutConstraintAxis,
1578 ) -> Retained<NSArray<NSLayoutConstraint>>;
1579
1580 #[unsafe(method(hasAmbiguousLayout))]
1581 #[unsafe(method_family = none)]
1582 pub unsafe fn hasAmbiguousLayout(&self) -> bool;
1583
1584 #[unsafe(method(exerciseAmbiguityInLayout))]
1585 #[unsafe(method_family = none)]
1586 pub unsafe fn exerciseAmbiguityInLayout(&self);
1587 );
1588}
1589
1590#[cfg(feature = "UILayoutGuide")]
1592impl UILayoutGuide {
1593 extern_methods!(
1594 #[cfg(feature = "NSLayoutConstraint")]
1595 #[unsafe(method(constraintsAffectingLayoutForAxis:))]
1596 #[unsafe(method_family = none)]
1597 pub unsafe fn constraintsAffectingLayoutForAxis(
1598 &self,
1599 axis: UILayoutConstraintAxis,
1600 ) -> Retained<NSArray<NSLayoutConstraint>>;
1601
1602 #[unsafe(method(hasAmbiguousLayout))]
1603 #[unsafe(method_family = none)]
1604 pub unsafe fn hasAmbiguousLayout(&self) -> bool;
1605 );
1606}
1607
1608#[cfg(feature = "UIResponder")]
1610impl UIView {
1611 extern_methods!(
1612 #[unsafe(method(restorationIdentifier))]
1613 #[unsafe(method_family = none)]
1614 pub unsafe fn restorationIdentifier(&self) -> Option<Retained<NSString>>;
1615
1616 #[unsafe(method(setRestorationIdentifier:))]
1618 #[unsafe(method_family = none)]
1619 pub unsafe fn setRestorationIdentifier(&self, restoration_identifier: Option<&NSString>);
1620
1621 #[unsafe(method(encodeRestorableStateWithCoder:))]
1622 #[unsafe(method_family = none)]
1623 pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
1624
1625 #[unsafe(method(decodeRestorableStateWithCoder:))]
1626 #[unsafe(method_family = none)]
1627 pub unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);
1628 );
1629}
1630
1631#[cfg(feature = "UIResponder")]
1633impl UIView {
1634 extern_methods!(
1635 #[unsafe(method(snapshotViewAfterScreenUpdates:))]
1636 #[unsafe(method_family = none)]
1637 pub unsafe fn snapshotViewAfterScreenUpdates(
1638 &self,
1639 after_updates: bool,
1640 ) -> Option<Retained<UIView>>;
1641
1642 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1643 #[unsafe(method(resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:))]
1644 #[unsafe(method_family = none)]
1645 pub unsafe fn resizableSnapshotViewFromRect_afterScreenUpdates_withCapInsets(
1646 &self,
1647 rect: CGRect,
1648 after_updates: bool,
1649 cap_insets: UIEdgeInsets,
1650 ) -> Option<Retained<UIView>>;
1651
1652 #[cfg(feature = "objc2-core-foundation")]
1653 #[unsafe(method(drawViewHierarchyInRect:afterScreenUpdates:))]
1654 #[unsafe(method_family = none)]
1655 pub unsafe fn drawViewHierarchyInRect_afterScreenUpdates(
1656 &self,
1657 rect: CGRect,
1658 after_updates: bool,
1659 ) -> bool;
1660 );
1661}
1662
1663#[cfg(feature = "UIResponder")]
1665impl UIView {
1666 extern_methods!(
1667 #[deprecated = "Use the block-based animation API instead"]
1668 #[unsafe(method(beginAnimations:context:))]
1669 #[unsafe(method_family = none)]
1670 pub unsafe fn beginAnimations_context(
1671 animation_id: Option<&NSString>,
1672 context: *mut c_void,
1673 mtm: MainThreadMarker,
1674 );
1675
1676 #[deprecated = "Use the block-based animation API instead"]
1677 #[unsafe(method(commitAnimations))]
1678 #[unsafe(method_family = none)]
1679 pub unsafe fn commitAnimations(mtm: MainThreadMarker);
1680
1681 #[deprecated = "Use the block-based animation API instead"]
1682 #[unsafe(method(setAnimationDelegate:))]
1683 #[unsafe(method_family = none)]
1684 pub unsafe fn setAnimationDelegate(delegate: Option<&AnyObject>, mtm: MainThreadMarker);
1685
1686 #[deprecated = "Use the block-based animation API instead"]
1687 #[unsafe(method(setAnimationWillStartSelector:))]
1688 #[unsafe(method_family = none)]
1689 pub unsafe fn setAnimationWillStartSelector(selector: Option<Sel>, mtm: MainThreadMarker);
1690
1691 #[deprecated = "Use the block-based animation API instead"]
1692 #[unsafe(method(setAnimationDidStopSelector:))]
1693 #[unsafe(method_family = none)]
1694 pub unsafe fn setAnimationDidStopSelector(selector: Option<Sel>, mtm: MainThreadMarker);
1695
1696 #[deprecated = "Use the block-based animation API instead"]
1697 #[unsafe(method(setAnimationDuration:))]
1698 #[unsafe(method_family = none)]
1699 pub unsafe fn setAnimationDuration(duration: NSTimeInterval, mtm: MainThreadMarker);
1700
1701 #[deprecated = "Use the block-based animation API instead"]
1702 #[unsafe(method(setAnimationDelay:))]
1703 #[unsafe(method_family = none)]
1704 pub unsafe fn setAnimationDelay(delay: NSTimeInterval, mtm: MainThreadMarker);
1705
1706 #[deprecated = "Use the block-based animation API instead"]
1707 #[unsafe(method(setAnimationStartDate:))]
1708 #[unsafe(method_family = none)]
1709 pub unsafe fn setAnimationStartDate(start_date: &NSDate, mtm: MainThreadMarker);
1710
1711 #[deprecated = "Use the block-based animation API instead"]
1712 #[unsafe(method(setAnimationCurve:))]
1713 #[unsafe(method_family = none)]
1714 pub unsafe fn setAnimationCurve(curve: UIViewAnimationCurve, mtm: MainThreadMarker);
1715
1716 #[deprecated = "Use the block-based animation API instead"]
1717 #[unsafe(method(setAnimationRepeatCount:))]
1718 #[unsafe(method_family = none)]
1719 pub unsafe fn setAnimationRepeatCount(repeat_count: c_float, mtm: MainThreadMarker);
1720
1721 #[deprecated = "Use the block-based animation API instead"]
1722 #[unsafe(method(setAnimationRepeatAutoreverses:))]
1723 #[unsafe(method_family = none)]
1724 pub unsafe fn setAnimationRepeatAutoreverses(
1725 repeat_autoreverses: bool,
1726 mtm: MainThreadMarker,
1727 );
1728
1729 #[deprecated = "Use the block-based animation API instead"]
1730 #[unsafe(method(setAnimationBeginsFromCurrentState:))]
1731 #[unsafe(method_family = none)]
1732 pub unsafe fn setAnimationBeginsFromCurrentState(
1733 from_current_state: bool,
1734 mtm: MainThreadMarker,
1735 );
1736
1737 #[deprecated = "Use the block-based animation API instead"]
1738 #[unsafe(method(setAnimationTransition:forView:cache:))]
1739 #[unsafe(method_family = none)]
1740 pub unsafe fn setAnimationTransition_forView_cache(
1741 transition: UIViewAnimationTransition,
1742 view: &UIView,
1743 cache: bool,
1744 );
1745 );
1746}
1747
1748#[cfg(feature = "UIResponder")]
1750impl UIView {
1751 extern_methods!(
1752 #[cfg(feature = "UIInterface")]
1753 #[unsafe(method(overrideUserInterfaceStyle))]
1754 #[unsafe(method_family = none)]
1755 pub unsafe fn overrideUserInterfaceStyle(&self) -> UIUserInterfaceStyle;
1756
1757 #[cfg(feature = "UIInterface")]
1758 #[unsafe(method(setOverrideUserInterfaceStyle:))]
1760 #[unsafe(method_family = none)]
1761 pub unsafe fn setOverrideUserInterfaceStyle(
1762 &self,
1763 override_user_interface_style: UIUserInterfaceStyle,
1764 );
1765 );
1766}
1767
1768#[cfg(feature = "UIResponder")]
1770impl UIView {
1771 extern_methods!(
1772 #[cfg(feature = "UIContentSizeCategory")]
1773 #[unsafe(method(minimumContentSizeCategory))]
1788 #[unsafe(method_family = none)]
1789 pub unsafe fn minimumContentSizeCategory(&self) -> Option<Retained<UIContentSizeCategory>>;
1790
1791 #[cfg(feature = "UIContentSizeCategory")]
1792 #[unsafe(method(setMinimumContentSizeCategory:))]
1794 #[unsafe(method_family = none)]
1795 pub unsafe fn setMinimumContentSizeCategory(
1796 &self,
1797 minimum_content_size_category: Option<&UIContentSizeCategory>,
1798 );
1799
1800 #[cfg(feature = "UIContentSizeCategory")]
1801 #[unsafe(method(maximumContentSizeCategory))]
1802 #[unsafe(method_family = none)]
1803 pub unsafe fn maximumContentSizeCategory(&self) -> Option<Retained<UIContentSizeCategory>>;
1804
1805 #[cfg(feature = "UIContentSizeCategory")]
1806 #[unsafe(method(setMaximumContentSizeCategory:))]
1808 #[unsafe(method_family = none)]
1809 pub unsafe fn setMaximumContentSizeCategory(
1810 &self,
1811 maximum_content_size_category: Option<&UIContentSizeCategory>,
1812 );
1813
1814 #[unsafe(method(appliedContentSizeCategoryLimitsDescription))]
1818 #[unsafe(method_family = none)]
1819 pub unsafe fn appliedContentSizeCategoryLimitsDescription(&self) -> Retained<NSString>;
1820 );
1821}
1822
1823#[cfg(feature = "UIResponder")]
1824impl UIView {
1825 extern_methods!(
1826 #[cfg(feature = "UITraitCollection")]
1827 #[unsafe(method(traitOverrides))]
1828 #[unsafe(method_family = none)]
1829 pub unsafe fn traitOverrides(&self) -> Retained<ProtocolObject<dyn UITraitOverrides>>;
1830
1831 #[unsafe(method(updateTraitsIfNeeded))]
1834 #[unsafe(method_family = none)]
1835 pub unsafe fn updateTraitsIfNeeded(&self);
1836 );
1837}
1838
1839#[cfg(all(feature = "UIResponder", feature = "UITraitCollection"))]
1840unsafe impl UITraitChangeObservable for UIView {}