1.addSubview add subview to array and then add to View'slayer
- (void)addSubview:(UIView *)subview { [_subviews addObject:subview]; [_layer addSublayer:subview.layer]; }
}
2. If insertSubview adds your view as a subzone, then call [_layer insertSublayer:subview.layer atIndex:index];
- (void)insertSubview:(UIView *)subview atIndex:(NSInteger)index { [self addSubview:subview]; [_layer insertSublayer:subview.layer atIndex:index]; }
user2369870 Jan 23 '16 at 10:45 2016-01-23 10:45
source share