1/** 2 * Copyright (c) Facebook, Inc. and its affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 */ 7 8#import "RNCMaskedView.h" 9 10#import <React/UIView+React.h> 11 12@implementation RNCMaskedView 13 14- (void)didUpdateReactSubviews 15{ 16 // RNCMaskedView expects that the first subview rendered is the mask. 17 UIView *maskView = [self.reactSubviews firstObject]; 18 self.maskView = maskView; 19 20 // Add the other subviews to the view hierarchy 21 for (NSUInteger i = 1; i < self.reactSubviews.count; i++) { 22 UIView *subview = [self.reactSubviews objectAtIndex:i]; 23 [self addSubview:subview]; 24 } 25} 26 27- (void)displayLayer:(CALayer *)layer 28{ 29 // RCTView uses displayLayer to do border rendering. 30 // We don't need to do that in RNCMaskedView, so we 31 // stub this method and override the default implementation. 32} 33 34@end 35