I must be doing something wrong obviously. My delegate doesn't get called when I set the frame of a view.
Frame version NOT working
-(void)someMethod {
CAAnimation *anim = [CABasicAnimation animation];
[anim setDelegate:self];
[[currentViewController view] setAnimations:[NSDictionary dictionaryWithObject:anim forKey:@"frame"]];
[[newViewController view] setAnimations:[NSDictionary dictionaryWithObject:anim forKey:@"frame"]];
[[[currentViewController view] animator] setFrame:currentTarget];
[[[newViewController view] animator] setFrame:newTarget];
}
- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)flag {
NSLog(@"Yep; works!");
}
Weirdly enough; the same code using alphaValue does work:
-(void)someMethod {
CAAnimation *anim = [CABasicAnimation animation];
[anim setDelegate:self];
[[currentViewController view] setAnimations:[NSDictionary dictionaryWithObject:anim forKey:@"alphaValue"]];
[[newViewController view] setAnimations:[NSDictionary dictionaryWithObject:anim forKey:@"alphaValue"]];
[[[currentViewController view] animator] setAlphaValue:0.5];
[[[newViewController view] animator] setAlphaValue:0.5];
}
- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)flag {
NSLog(@"Yep; works!");
}
Can you tell me what I am missing here? I just don't understand. Thank you for your time.