diff --git a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj index 4745f20e8..cdc99eeac 100644 --- a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj +++ b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj @@ -51,6 +51,8 @@ 3DED3A9E1DE6F7A400336DD7 /* RCTImageViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1304D5A91AA8C4A30002E2BE /* RCTImageViewManager.h */; }; 3DED3A9F1DE6F7A400336DD7 /* RCTLocalAssetImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 13EF7F7D1BC825B1003F47DD /* RCTLocalAssetImageLoader.h */; }; 3DED3AA01DE6F7A400336DD7 /* RCTResizeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */; }; + 59AB092A1EDE5DD1009F97B5 /* RCTImageShadowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59AB09281EDE5DD1009F97B5 /* RCTImageShadowView.h */; }; + 59AB092B1EDE5DD1009F97B5 /* RCTImageShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59AB09291EDE5DD1009F97B5 /* RCTImageShadowView.m */; }; CCD34C271D4B8FE900268922 /* RCTImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CCD34C261D4B8FE900268922 /* RCTImageCache.m */; }; EEF314721C9B0DD30049118E /* RCTImageBlurUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EEF314711C9B0DD30049118E /* RCTImageBlurUtils.m */; }; /* End PBXBuildFile section */ @@ -102,6 +104,8 @@ 3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTResizeMode.h; sourceTree = ""; }; 3D5FA68C1DE4BA290058FD77 /* libRCTNetwork.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRCTNetwork.a; path = "../Network/build/Debug-iphoneos/libRCTNetwork.a"; sourceTree = ""; }; 58B5115D1A9E6B3D00147676 /* libRCTImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 59AB09281EDE5DD1009F97B5 /* RCTImageShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageShadowView.h; sourceTree = ""; }; + 59AB09291EDE5DD1009F97B5 /* RCTImageShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageShadowView.m; sourceTree = ""; }; CCD34C251D4B8FE900268922 /* RCTImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageCache.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; CCD34C261D4B8FE900268922 /* RCTImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageCache.m; sourceTree = ""; }; EEF314701C9B0DD30049118E /* RCTImageBlurUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTImageBlurUtils.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -120,6 +124,8 @@ 58B511541A9E6B3D00147676 = { isa = PBXGroup; children = ( + 3D5FA68B1DE4BA290058FD77 /* Frameworks */, + 58B5115E1A9E6B3D00147676 /* Products */, 1304D5B01AA8C50D0002E2BE /* RCTGIFImageDecoder.h */, 1304D5B11AA8C50D0002E2BE /* RCTGIFImageDecoder.m */, EEF314701C9B0DD30049118E /* RCTImageBlurUtils.h */, @@ -130,6 +136,8 @@ 354631671B69857700AA0B86 /* RCTImageEditingManager.m */, 3D5FA63C1DE4B44A0058FD77 /* RCTImageLoader.h */, 143879371AAD32A300F088A5 /* RCTImageLoader.m */, + 59AB09281EDE5DD1009F97B5 /* RCTImageShadowView.h */, + 59AB09291EDE5DD1009F97B5 /* RCTImageShadowView.m */, 3D5FA63D1DE4B44A0058FD77 /* RCTImageStoreManager.h */, 35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */, 134B00A01B54232B00EC8DFB /* RCTImageUtils.h */, @@ -142,8 +150,6 @@ 13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */, 3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */, 139A38831C4D587C00862840 /* RCTResizeMode.m */, - 58B5115E1A9E6B3D00147676 /* Products */, - 3D5FA68B1DE4BA290058FD77 /* Frameworks */, ); indentWidth = 2; sourceTree = ""; @@ -172,6 +178,7 @@ 3DED3A8D1DE6F79800336DD7 /* RCTImageEditingManager.h in Headers */, 3DED3A8E1DE6F79800336DD7 /* RCTImageLoader.h in Headers */, 3DED3A8F1DE6F79800336DD7 /* RCTImageStoreManager.h in Headers */, + 59AB092A1EDE5DD1009F97B5 /* RCTImageShadowView.h in Headers */, 3DED3A911DE6F79800336DD7 /* RCTImageView.h in Headers */, 3DED3A921DE6F79800336DD7 /* RCTImageViewManager.h in Headers */, 3DED3A931DE6F79800336DD7 /* RCTLocalAssetImageLoader.h in Headers */, @@ -301,6 +308,7 @@ 139A38841C4D587C00862840 /* RCTResizeMode.m in Sources */, 1304D5AB1AA8C4A30002E2BE /* RCTImageView.m in Sources */, EEF314721C9B0DD30049118E /* RCTImageBlurUtils.m in Sources */, + 59AB092B1EDE5DD1009F97B5 /* RCTImageShadowView.m in Sources */, 13EF7F7F1BC825B1003F47DD /* RCTLocalAssetImageLoader.m in Sources */, 134B00A21B54232B00EC8DFB /* RCTImageUtils.m in Sources */, CCD34C271D4B8FE900268922 /* RCTImageCache.m in Sources */, diff --git a/Libraries/Image/RCTImageShadowView.h b/Libraries/Image/RCTImageShadowView.h new file mode 100644 index 000000000..292a79074 --- /dev/null +++ b/Libraries/Image/RCTImageShadowView.h @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@interface RCTImageShadowView : RCTShadowView + +@end diff --git a/Libraries/Image/RCTImageShadowView.m b/Libraries/Image/RCTImageShadowView.m new file mode 100644 index 000000000..ceed9c8b6 --- /dev/null +++ b/Libraries/Image/RCTImageShadowView.m @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "RCTImageShadowView.h" + +#import + +@implementation RCTImageShadowView + +- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex +{ + RCTLogWarn(@"Using with children is deprecated " + "and will be an error in the near future. " + "Please reconsider the layout or use instead."); + + [super insertReactSubview:subview atIndex:atIndex]; +} + +@end diff --git a/Libraries/Image/RCTImageViewManager.m b/Libraries/Image/RCTImageViewManager.m index 3b1035f96..b313e016f 100644 --- a/Libraries/Image/RCTImageViewManager.m +++ b/Libraries/Image/RCTImageViewManager.m @@ -14,12 +14,18 @@ #import #import "RCTImageLoader.h" +#import "RCTImageShadowView.h" #import "RCTImageView.h" @implementation RCTImageViewManager RCT_EXPORT_MODULE() +- (RCTShadowView *)shadowView +{ + return [RCTImageShadowView new]; +} + - (UIView *)view { return [[RCTImageView alloc] initWithBridge:self.bridge];