objc2_ui_kit/generated/
UIViewControllerTransition.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewcontrollertransition?language=objc)
10    #[unsafe(super(NSObject))]
11    #[derive(Debug, PartialEq, Eq, Hash)]
12    pub struct UIViewControllerTransition;
13);
14
15extern_conformance!(
16    unsafe impl NSObjectProtocol for UIViewControllerTransition {}
17);
18
19impl UIViewControllerTransition {
20    extern_methods!(
21        #[cfg(all(
22            feature = "UIResponder",
23            feature = "UIView",
24            feature = "UIZoomTransitionOptions",
25            feature = "block2"
26        ))]
27        /// Zoom from the view provided by the `sourceViewProvider` to the presented or pushed view controller's view.
28        /// The transition's `sourceViewProvider` is called whenever the transition needs to request a source view.
29        /// Note that it may be called multiple times during the transition's lifecycle in order
30        /// to ensure that the transition incorporates the most up-to-date visuals.
31        ///
32        /// **Example**
33        ///
34        /// Consider an interface where a user may tap a cell representing a city to present a detail view.
35        /// In the detail view, they may swipe left or right to go to the next city in the list. When the detail view
36        /// is dismissed, it should un-zoom to the currently selected city rather than the one that was first selected.
37        /// ```text
38        /// cityViewController.preferredTransition = .zoom { context in
39        /// let displayed = context.displayedViewController as! CityViewController
40        /// let source = context.sourceViewController as! CityListViewController
41        /// return source.cell(for: displayed.cityId)
42        /// }
43        /// present(cityViewController, animated: true)
44        /// ```
45        #[unsafe(method(zoomWithOptions:sourceViewProvider:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn zoomWithOptions_sourceViewProvider(
48            options: Option<&UIZoomTransitionOptions>,
49            source_view_provider: &block2::DynBlock<
50                dyn Fn(NonNull<UIZoomTransitionSourceViewProviderContext>) -> *mut UIView,
51            >,
52        ) -> Retained<Self>;
53
54        /// View slides up from the bottom of the screen. Same as `UIModalTransitionStyle.coverVertical`.
55        #[unsafe(method(coverVerticalTransition))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn coverVerticalTransition() -> Retained<Self>;
58
59        /// View flips horizontally in 3D. Same as `UIModalTransitionStyle.flipHorizontal`.
60        #[unsafe(method(flipHorizontalTransition))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn flipHorizontalTransition() -> Retained<Self>;
63
64        /// Fades out the current view while fading in the new view. Same as `UIModalTransitionStyle.crossDissolve`.
65        #[unsafe(method(crossDissolveTransition))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn crossDissolveTransition() -> Retained<Self>;
68
69        /// One corner of the current view curls up to reveal the presented view underneath. Same as `UIModalTransitionStyle.partialCurl`.
70        #[unsafe(method(partialCurlTransition))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn partialCurlTransition() -> Retained<Self>;
73
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub unsafe fn new() -> Retained<Self>;
81    );
82}
83
84extern_class!(
85    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uizoomtransitionsourceviewprovidercontext?language=objc)
86    #[unsafe(super(NSObject))]
87    #[derive(Debug, PartialEq, Eq, Hash)]
88    pub struct UIZoomTransitionSourceViewProviderContext;
89);
90
91extern_conformance!(
92    unsafe impl NSObjectProtocol for UIZoomTransitionSourceViewProviderContext {}
93);
94
95impl UIZoomTransitionSourceViewProviderContext {
96    extern_methods!(
97        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
98        /// View controller that is the source of the zoom transition.
99        #[unsafe(method(sourceViewController))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn sourceViewController(
102            &self,
103            mtm: MainThreadMarker,
104        ) -> Retained<UIViewController>;
105
106        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
107        /// The view controller being zoomed into by the transition.
108        #[unsafe(method(zoomedViewController))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn zoomedViewController(
111            &self,
112            mtm: MainThreadMarker,
113        ) -> Retained<UIViewController>;
114
115        #[unsafe(method(init))]
116        #[unsafe(method_family = init)]
117        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
118
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}