1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    pub unsafe trait UIDynamicAnimatorDelegate: NSObjectProtocol + IsMainThreadOnly {
        #[optional]
        #[method(dynamicAnimatorWillResume:)]
        unsafe fn dynamicAnimatorWillResume(&self, animator: &UIDynamicAnimator);

        #[optional]
        #[method(dynamicAnimatorDidPause:)]
        unsafe fn dynamicAnimatorDidPause(&self, animator: &UIDynamicAnimator);
    }

    unsafe impl ProtocolType for dyn UIDynamicAnimatorDelegate {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIDynamicAnimator;

    unsafe impl ClassType for UIDynamicAnimator {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for UIDynamicAnimator {}

extern_methods!(
    unsafe impl UIDynamicAnimator {
        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[method_id(@__retain_semantics Init initWithReferenceView:)]
        pub unsafe fn initWithReferenceView(this: Allocated<Self>, view: &UIView)
            -> Retained<Self>;

        #[cfg(feature = "UIDynamicBehavior")]
        #[method(addBehavior:)]
        pub unsafe fn addBehavior(&self, behavior: &UIDynamicBehavior);

        #[cfg(feature = "UIDynamicBehavior")]
        #[method(removeBehavior:)]
        pub unsafe fn removeBehavior(&self, behavior: &UIDynamicBehavior);

        #[method(removeAllBehaviors)]
        pub unsafe fn removeAllBehaviors(&self);

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[method_id(@__retain_semantics Other referenceView)]
        pub unsafe fn referenceView(&self, mtm: MainThreadMarker) -> Option<Retained<UIView>>;

        #[cfg(feature = "UIDynamicBehavior")]
        #[method_id(@__retain_semantics Other behaviors)]
        pub unsafe fn behaviors(
            &self,
            mtm: MainThreadMarker,
        ) -> Retained<NSArray<UIDynamicBehavior>>;

        #[cfg(feature = "UIDynamicBehavior")]
        #[method_id(@__retain_semantics Other itemsInRect:)]
        pub unsafe fn itemsInRect(
            &self,
            rect: CGRect,
            mtm: MainThreadMarker,
        ) -> Retained<NSArray<ProtocolObject<dyn UIDynamicItem>>>;

        #[cfg(feature = "UIDynamicBehavior")]
        #[method(updateItemUsingCurrentState:)]
        pub unsafe fn updateItemUsingCurrentState(&self, item: &ProtocolObject<dyn UIDynamicItem>);

        #[method(isRunning)]
        pub unsafe fn isRunning(&self) -> bool;

        #[method(elapsedTime)]
        pub unsafe fn elapsedTime(&self) -> NSTimeInterval;

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
            mtm: MainThreadMarker,
        ) -> Option<Retained<ProtocolObject<dyn UIDynamicAnimatorDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn UIDynamicAnimatorDelegate>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl UIDynamicAnimator {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_methods!(
    /// UICollectionViewAdditions
    unsafe impl UIDynamicAnimator {
        #[cfg(feature = "UICollectionViewLayout")]
        #[method_id(@__retain_semantics Init initWithCollectionViewLayout:)]
        pub unsafe fn initWithCollectionViewLayout(
            this: Allocated<Self>,
            layout: &UICollectionViewLayout,
        ) -> Retained<Self>;

        #[cfg(feature = "UICollectionViewLayout")]
        #[method_id(@__retain_semantics Other layoutAttributesForCellAtIndexPath:)]
        pub unsafe fn layoutAttributesForCellAtIndexPath(
            &self,
            index_path: &NSIndexPath,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UICollectionViewLayoutAttributes>>;

        #[cfg(feature = "UICollectionViewLayout")]
        #[method_id(@__retain_semantics Other layoutAttributesForSupplementaryViewOfKind:atIndexPath:)]
        pub unsafe fn layoutAttributesForSupplementaryViewOfKind_atIndexPath(
            &self,
            kind: &NSString,
            index_path: &NSIndexPath,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UICollectionViewLayoutAttributes>>;

        #[cfg(feature = "UICollectionViewLayout")]
        #[method_id(@__retain_semantics Other layoutAttributesForDecorationViewOfKind:atIndexPath:)]
        pub unsafe fn layoutAttributesForDecorationViewOfKind_atIndexPath(
            &self,
            decoration_view_kind: &NSString,
            index_path: &NSIndexPath,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UICollectionViewLayoutAttributes>>;
    }
);