Xcode- iOS Animation RBBCustomAnimation

RBBCustomAnimation

Use RBBCustomAnimation to create arbitrary animations by passing in an RBBAnimationBlock:


RBBCustomAnimation *rainbow = [RBBCustomAnimation animationWithKeyPath:@"backgroundColor"];

rainbow.animationBlock = ^(CGFloat elapsed, CGFloat duration) {
    UIColor *color = [UIColor colorWithHue:elapsed / duration
                                saturation:1
                                brightness:1
                                     alpha:1];

    return (id)color.CGColor;
};
The arguments of the block are the current position of the animation as well as its total duration.

Xcode- iOS Animation RBBCustomAnimation Xcode- iOS Animation RBBCustomAnimation Reviewed by Unknown on 2:02 PM Rating: 5

No comments:

Powered by Blogger.