File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -20,20 +20,21 @@ - (instancetype)initWithData:(id) data type:(RNSharedElementContentType)type ins
2020
2121+ (BOOL ) isKindOfImageView : (UIView*) view
2222{
23+ NSString * className = NSStringFromClass (view.class );
2324 return (
2425 [view isKindOfClass: [UIImageView class ]] ||
25- [NSStringFromClass (view.class) isEqualToString: @" RCTImageView" ]
26+ [className isEqualToString: @" RCTImageView" ] ||
27+ [className isEqualToString: @" ExpoImage.ImageView" ]
2628 );
2729}
2830
2931+ (UIImageView*) imageViewFromView : (UIView*) view
3032{
3133 if ([view isKindOfClass: [UIImageView class ]]) {
3234 return (UIImageView*) view;
33- } else if ([NSStringFromClass (view.class) isEqualToString: @" RCTImageView" ]) {
34- // As of react-native 0.60, RCTImageView is no longer inherited from
35- // UIImageView, but has a UIImageView as child. That will cause this code-path
36- // to be executed, where the first child view is returned.
35+ } else if ([RNSharedElementContent isKindOfImageView: view]) {
36+ // Both react-native and expo-image have a UIImageView
37+ // as the first child.
3738 return (UIImageView*) view.subviews .firstObject ;
3839 } else {
3940 // Error
You can’t perform that action at this time.
0 commit comments