intuit / animationengine Goto Github PK
View Code? Open in Web Editor NEWEasily build advanced custom animations on iOS.
License: MIT License
Easily build advanced custom animations on iOS.
License: MIT License
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
I'm new to apple programming, and am learning only swift language.
Is there a swift version of this library? Or a an example of how to use in Swift?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.