- Doing animation in core animation after adding layer to superlayer
- // create sublayer
- sublayer.position = p1;
- [superlayer addSublayer:sublayer];
- sublayer.position = p2;
- {
- ...
- sublayer.position = p1;
- [superlayer addSublayer:sublayer];
- [self performSelector:@selector(changePosition:)
- delay:0
- withObject:sublayer];
- ...
- }
- -(void)changePosition:(CALayer*)layer
- {
- layer.position = p2;
- }