Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 6043dcb673
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (33 sloc) 1.208 kB
// Copyright (c) 2010-2011, Rasmus Andersson. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
#import "KAnimation.h"
@implementation KAnimation
@synthesize onEnd = onEnd_,
onProgress = onProgress_;
+ (KAnimation*)animationWithDuration:(NSTimeInterval)duration
animationCurve:(NSAnimationCurve)animationCurve {
return [[[self alloc] initWithDuration:duration
animationCurve:animationCurve] autorelease];
- (id)initWithDuration:(NSTimeInterval)duration
animationCurve:(NSAnimationCurve)animationCurve {
if (!(self = [super initWithDuration:duration
return nil;
[self setDelegate:self];
[self setAnimationBlockingMode:NSAnimationNonblocking];
return self;
- (void)dealloc {
if (onEnd_) [onEnd_ release];
if (onProgress_) [onProgress_ release];
[super dealloc];
- (void)animationDidEnd:(NSAnimation *)animation {
if (onEnd_ && animation == self) onEnd_();
- (void)setCurrentProgress:(NSAnimationProgress)progress {
if (onProgress_) onProgress_(progress);
Jump to Line
Something went wrong with that request. Please try again.