Code Monkey home page Code Monkey logo

animationengine's People

Contributors

krstnfx avatar smileyborg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animationengine's Issues

Modifying activeAnimations while enumerating through it

Howdy! Not sure if I'm going about this in a weird way, but I must be somehow calling the addAnimation/removeAnimationWithID while tickActiveAnimations is being called, making my app crash.

My basic solution is to make two more collections that modify activeAnimations after it's done looping.

@property (nonatomic, strong) NSMutableArray *animationsToAdd;
@property (nonatomic, strong) NSMutableDictionary *animationsToRemove;

Insert/remove the animations immediately after the for loop in tickActiveAnimations

for (JotINTUAnimation *anim in self.animationsToAdd) {
    anim.startTime = CACurrentMediaTime();
    [self.activeAnimations setObject:anim forKey:@(anim.animationID)];
}

for (NSNumber *animationID in [self.animationsToRemove keyEnumerator]) {
    JotINTUAnimation *animation = [self.activeAnimations objectForKey:animationID];
    [animation complete:[[self.animationsToRemove objectForKey:animationID] boolValue]];
    [self.activeAnimations removeObjectForKey:animationID];
    if ([self.activeAnimations count] == 0) {
        self.displayLink.paused = YES;
    }
}

[self.animationsToRemove removeAllObjects];
[self.animationsToAdd removeAllObjects];

Rewrite the basic addAnimation and removeAnimationWithID methods

- (void)addAnimation:(JotINTUAnimation *)animation
{
    if ([self.activeAnimations count] == 0) {
        self.displayLink.paused = NO;
    }

    [self.animationsToAdd addObject:animation];
}

- (void)removeAnimationWithID:(JotINTUAnimationID)animationID didFinish:(BOOL)finished
{
    [self.animationsToRemove setObject:@(finished) forKey:@(animationID)];
}

This is my first issue I've ever created, if you want me to submit a PR let me know. Also, if I am totally overengineering this problem, let me know that as well :D

Swift compatibility

Trying to call INTUAnimationEngine.animateWithDuration(1.0, delay: 0.0, easing: INTUEaseInBounce, animations: nil, completion: nil) from swift code but getting "Extra argument 'easing' in call" error. Probably there is something with this line from INTUEasingFunctions.h:

typedef CGFloat (*INTUEasingFunction)(CGFloat);

How should I use this method from swift code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.