objc2_ui_kit/generated/
UIViewControllerTransitionCoordinator.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12pub type UITransitionContextViewControllerKey = NSString;
15
16pub type UITransitionContextViewKey = NSString;
19
20extern_protocol!(
21 pub unsafe trait UIViewControllerTransitionCoordinatorContext:
23 NSObjectProtocol + MainThreadOnly
24 {
25 #[unsafe(method(isAnimated))]
26 #[unsafe(method_family = none)]
27 unsafe fn isAnimated(&self) -> bool;
28
29 #[cfg(feature = "UIViewController")]
30 #[unsafe(method(presentationStyle))]
31 #[unsafe(method_family = none)]
32 unsafe fn presentationStyle(&self) -> UIModalPresentationStyle;
33
34 #[unsafe(method(initiallyInteractive))]
39 #[unsafe(method_family = none)]
40 unsafe fn initiallyInteractive(&self) -> bool;
41
42 #[unsafe(method(isInterruptible))]
43 #[unsafe(method_family = none)]
44 unsafe fn isInterruptible(&self) -> bool;
45
46 #[unsafe(method(isInteractive))]
47 #[unsafe(method_family = none)]
48 unsafe fn isInteractive(&self) -> bool;
49
50 #[unsafe(method(isCancelled))]
51 #[unsafe(method_family = none)]
52 unsafe fn isCancelled(&self) -> bool;
53
54 #[unsafe(method(transitionDuration))]
55 #[unsafe(method_family = none)]
56 unsafe fn transitionDuration(&self) -> NSTimeInterval;
57
58 #[cfg(feature = "objc2-core-foundation")]
59 #[unsafe(method(percentComplete))]
60 #[unsafe(method_family = none)]
61 unsafe fn percentComplete(&self) -> CGFloat;
62
63 #[cfg(feature = "objc2-core-foundation")]
64 #[unsafe(method(completionVelocity))]
65 #[unsafe(method_family = none)]
66 unsafe fn completionVelocity(&self) -> CGFloat;
67
68 #[cfg(feature = "UIView")]
69 #[unsafe(method(completionCurve))]
70 #[unsafe(method_family = none)]
71 unsafe fn completionCurve(&self) -> UIViewAnimationCurve;
72
73 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
74 #[unsafe(method(viewControllerForKey:))]
75 #[unsafe(method_family = none)]
76 unsafe fn viewControllerForKey(
77 &self,
78 key: &UITransitionContextViewControllerKey,
79 ) -> Option<Retained<UIViewController>>;
80
81 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
82 #[unsafe(method(viewForKey:))]
83 #[unsafe(method_family = none)]
84 unsafe fn viewForKey(&self, key: &UITransitionContextViewKey) -> Option<Retained<UIView>>;
85
86 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
87 #[unsafe(method(containerView))]
88 #[unsafe(method_family = none)]
89 unsafe fn containerView(&self) -> Retained<UIView>;
90
91 #[cfg(feature = "objc2-core-foundation")]
92 #[unsafe(method(targetTransform))]
93 #[unsafe(method_family = none)]
94 unsafe fn targetTransform(&self) -> CGAffineTransform;
95 }
96);
97
98extern_protocol!(
99 pub unsafe trait UIViewControllerTransitionCoordinator:
101 UIViewControllerTransitionCoordinatorContext + MainThreadOnly
102 {
103 #[cfg(feature = "block2")]
104 #[unsafe(method(animateAlongsideTransition:completion:))]
105 #[unsafe(method_family = none)]
106 unsafe fn animateAlongsideTransition_completion(
107 &self,
108 animation: Option<
109 &block2::DynBlock<
110 dyn Fn(
111 NonNull<ProtocolObject<dyn UIViewControllerTransitionCoordinatorContext>>,
112 ),
113 >,
114 >,
115 completion: Option<
116 &block2::DynBlock<
117 dyn Fn(
118 NonNull<ProtocolObject<dyn UIViewControllerTransitionCoordinatorContext>>,
119 ),
120 >,
121 >,
122 ) -> bool;
123
124 #[cfg(all(feature = "UIResponder", feature = "UIView", feature = "block2"))]
125 #[unsafe(method(animateAlongsideTransitionInView:animation:completion:))]
126 #[unsafe(method_family = none)]
127 unsafe fn animateAlongsideTransitionInView_animation_completion(
128 &self,
129 view: Option<&UIView>,
130 animation: Option<
131 &block2::DynBlock<
132 dyn Fn(
133 NonNull<ProtocolObject<dyn UIViewControllerTransitionCoordinatorContext>>,
134 ),
135 >,
136 >,
137 completion: Option<
138 &block2::DynBlock<
139 dyn Fn(
140 NonNull<ProtocolObject<dyn UIViewControllerTransitionCoordinatorContext>>,
141 ),
142 >,
143 >,
144 ) -> bool;
145
146 #[cfg(feature = "block2")]
147 #[deprecated]
148 #[unsafe(method(notifyWhenInteractionEndsUsingBlock:))]
149 #[unsafe(method_family = none)]
150 unsafe fn notifyWhenInteractionEndsUsingBlock(
151 &self,
152 handler: &block2::DynBlock<
153 dyn Fn(NonNull<ProtocolObject<dyn UIViewControllerTransitionCoordinatorContext>>),
154 >,
155 );
156
157 #[cfg(feature = "block2")]
158 #[unsafe(method(notifyWhenInteractionChangesUsingBlock:))]
159 #[unsafe(method_family = none)]
160 unsafe fn notifyWhenInteractionChangesUsingBlock(
161 &self,
162 handler: &block2::DynBlock<
163 dyn Fn(NonNull<ProtocolObject<dyn UIViewControllerTransitionCoordinatorContext>>),
164 >,
165 );
166 }
167);
168
169#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
171impl UIViewController {
172 extern_methods!(
173 #[unsafe(method(transitionCoordinator))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn transitionCoordinator(
176 &self,
177 ) -> Option<Retained<ProtocolObject<dyn UIViewControllerTransitionCoordinator>>>;
178 );
179}