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