Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 16th, 2012  |  syntax: None  |  size: 0.44 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Doing animation in core animation after adding layer to superlayer
  2. // create sublayer
  3. sublayer.position = p1;
  4. [superlayer addSublayer:sublayer];
  5. sublayer.position = p2;
  6.        
  7. {
  8.     ...
  9.     sublayer.position = p1;
  10.     [superlayer addSublayer:sublayer];
  11.     [self performSelector:@selector(changePosition:)
  12.                     delay:0
  13.                withObject:sublayer];
  14.     ...
  15. }
  16.  
  17. -(void)changePosition:(CALayer*)layer
  18. {
  19.     layer.position = p2;
  20. }