I've set up a CALayer for a simple animation.
Both the bounds, frame, contentsRect and all the other possible CGRect properties return nil.
Am I, or rather, what am I doing wrong here ?
Code:
CALayer *monsterLayer = [CALayer layer];
[monsterLayer setContents:(id)monsterImage.CGImage];
[monsterLayer setFrame:CGRectMake(0,0,48,48)];
[monsterLayer setBounds:CGRectMake(0,0,48,48)];
//[monsterLayer setPosition:CGPointMake(100,100)];
[monsterLayer setBorderWidth:1.0f];
[monsterLayer setBorderColor:[UIColor orangeColor].CGColor];
[monsterLayer addAnimation:animation forKey:@"position"];
[self.layer insertSublayer:monsterLayer atIndex:0];
// touch posiotion to trigger animation
monsterLayer.position = CGPointZero;
NSLog(@"monsterLayer: %@, monsterLayer.bounds);
NSLog(@"superlayer: %@", monsterLayer.superlayer.bounds);
Both the bounds, frame, contentsRect and all the other possible CGRect properties return nil.
Am I, or rather, what am I doing wrong here ?