IOS Core Advanced Tips – Article links

UIView *layerView = [[UIView alloc] initWithFrame:CGRectMake(100.0f, 100.0f, 200.0f, 200.0f)]; layerView.backgroundColor = [UIColor whiteColor]; [self.view addSubview:layerView]; CALayer *blueLayer = [CALayer layer]; Bluelayer. frame = CGRectMake(50.0f, 50.0f, 100.0f, 100.0f); blueLayer.backgroundColor = [UIColor blueColor].CGColor; [layerView.layer addSublayer:blueLayer];Copy the code