Quartz will probably optimize setting hidden = YES
on a hidden layer, but if you really want to find out you should benchmark.
Amuck
2009-09-30 18:57:48
Quartz will probably optimize setting hidden = YES
on a hidden layer, but if you really want to find out you should benchmark.
Why not do this:
- (void)setCharacterLeftFlag:flag {
if ( flag ) {
characterLeftView.layer.hidden = NO;
characterRightView.layer.hidden = YES;
}
else {
characterLeftView.layer.hidden = YES;
characterRightView.layer.hidden = NO;
}
}
this is your setter. Now, the OS may not even call drawRect, if it sees that the layer is hidden, and doesn't need to be redrawn.