objc2_ui_kit/generated/
UITrackingLayoutGuide.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitrackinglayoutguide?language=objc)
12    #[unsafe(super(UILayoutGuide, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UILayoutGuide")]
16    pub struct UITrackingLayoutGuide;
17);
18
19#[cfg(feature = "UILayoutGuide")]
20unsafe impl NSCoding for UITrackingLayoutGuide {}
21
22#[cfg(feature = "UILayoutGuide")]
23unsafe impl NSObjectProtocol for UITrackingLayoutGuide {}
24
25#[cfg(feature = "UILayoutGuide")]
26impl UITrackingLayoutGuide {
27    extern_methods!(
28        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
29        /// Parameter `trackingConstraints`: Constraints to activate when the guide is close to the specified edge, and deactivate when it moves away. Sending nil will deactivate any currently active constraints associated with this edge and remove them from tracking.
30        ///
31        /// Parameter `edge`: When the tracking layout guide is close to this edge, specified constraints will change
32        #[unsafe(method(setConstraints:activeWhenNearEdge:))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn setConstraints_activeWhenNearEdge(
35            &self,
36            tracking_constraints: &NSArray<NSLayoutConstraint>,
37            edge: NSDirectionalRectEdge,
38        );
39
40        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
41        #[unsafe(method(constraintsActiveWhenNearEdge:))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn constraintsActiveWhenNearEdge(
44            &self,
45            edge: NSDirectionalRectEdge,
46        ) -> Retained<NSArray<NSLayoutConstraint>>;
47
48        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
49        /// Parameter `trackingConstraints`: Constraints to deactivate when the guide is close to the specified edge, and activate when it moves away. Sending nil will remove the constraints associated with this edge from tracking.
50        ///
51        /// Parameter `edge`: When the tracking layout guide is close to this edge, specified constraints will change
52        #[unsafe(method(setConstraints:activeWhenAwayFromEdge:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setConstraints_activeWhenAwayFromEdge(
55            &self,
56            tracking_constraints: &NSArray<NSLayoutConstraint>,
57            edge: NSDirectionalRectEdge,
58        );
59
60        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
61        #[unsafe(method(constraintsActiveWhenAwayFromEdge:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn constraintsActiveWhenAwayFromEdge(
64            &self,
65            edge: NSDirectionalRectEdge,
66        ) -> Retained<NSArray<NSLayoutConstraint>>;
67
68        /// Manually remove all constraints from this guide's tracking.
69        #[unsafe(method(removeAllTrackedConstraints))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn removeAllTrackedConstraints(&self);
72    );
73}
74
75/// Methods declared on superclass `NSObject`.
76#[cfg(feature = "UILayoutGuide")]
77impl UITrackingLayoutGuide {
78    extern_methods!(
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[unsafe(method(new))]
84        #[unsafe(method_family = new)]
85        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
86    );
87}