Animating Transitions

Animating Transitions

 

- (void)keyDown:(NSEvent *)event {
   if(nil != [self.beach superview]) {
    [[self animator] replaceSubview:self.beach with:self.snow];
} else if(nil != [self.snow superview]) {
    [[self animator] replaceSubview:self.snow with:self.beach];
   }
}

 

- (CATransition *)animation {
         CATransition *trans = [CATransition animation];
         trans.type = kCATransitionMoveIn;
         trans.subtype = kCATransitionFromTop;
         return trans;
}
 

 

写道
self.animations = [NSDictionary dictionaryWithObject:[self animation] forKey:@"subviews"];,

 

你可能感兴趣的:(transition)