13
13
// limitations under the License.
14
14
15
15
#import " MDCFloatingButton+Animation.h"
16
+ #import " MDCFloatingButton.h"
16
17
17
18
#if TARGET_IPHONE_SIMULATOR
18
19
float UIAnimationDragCoefficient (void ); // Private API for simulator animation speed
@@ -96,8 +97,10 @@ - (void)expand:(BOOL)animated completion:(void (^_Nullable)(void))completion {
96
97
#ifdef __IPHONE_13_4
97
98
BOOL wasPointerInteractionEnabled = NO ;
98
99
if (@available (iOS 13.4 , *)) {
99
- wasPointerInteractionEnabled = self.pointerInteractionEnabled ;
100
- self.pointerInteractionEnabled = NO ;
100
+ if ([self respondsToSelector: @selector (isPointerInteractionEnabled )]) {
101
+ wasPointerInteractionEnabled = self.pointerInteractionEnabled ;
102
+ self.pointerInteractionEnabled = NO ;
103
+ }
101
104
}
102
105
#endif
103
106
void (^expandActions)(void ) = ^{
@@ -111,7 +114,9 @@ - (void)expand:(BOOL)animated completion:(void (^_Nullable)(void))completion {
111
114
[self .imageView.layer removeAnimationForKey: kMDCFloatingButtonTransformKey ];
112
115
#ifdef __IPHONE_13_4
113
116
if (@available (iOS 13.4 , *)) {
114
- self.pointerInteractionEnabled = wasPointerInteractionEnabled;
117
+ if ([self respondsToSelector: @selector (isPointerInteractionEnabled )]) {
118
+ self.pointerInteractionEnabled = wasPointerInteractionEnabled;
119
+ }
115
120
}
116
121
#endif
117
122
if (completion) {
@@ -188,8 +193,10 @@ - (void)collapse:(BOOL)animated completion:(void (^_Nullable)(void))completion {
188
193
#ifdef __IPHONE_13_4
189
194
BOOL wasPointerInteractionEnabled = NO ;
190
195
if (@available (iOS 13.4 , *)) {
191
- wasPointerInteractionEnabled = self.pointerInteractionEnabled ;
192
- self.pointerInteractionEnabled = NO ;
196
+ if ([self respondsToSelector: @selector (isPointerInteractionEnabled )]) {
197
+ wasPointerInteractionEnabled = self.pointerInteractionEnabled ;
198
+ self.pointerInteractionEnabled = NO ;
199
+ }
193
200
}
194
201
#endif
195
202
@@ -204,7 +211,9 @@ - (void)collapse:(BOOL)animated completion:(void (^_Nullable)(void))completion {
204
211
[self .imageView.layer removeAnimationForKey: kMDCFloatingButtonTransformKey ];
205
212
#ifdef __IPHONE_13_4
206
213
if (@available (iOS 13.4 , *)) {
207
- self.pointerInteractionEnabled = wasPointerInteractionEnabled;
214
+ if ([self respondsToSelector: @selector (isPointerInteractionEnabled )]) {
215
+ self.pointerInteractionEnabled = wasPointerInteractionEnabled;
216
+ }
208
217
}
209
218
#endif
210
219
if (completion) {
0 commit comments