Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set up NSAnimationContext groupings in parallel with TUIView animatio…

…ns, so that any direct NSView changes are animated in parallel
  • Loading branch information...
commit 585ca4aa59ffa3b0a00be3b8d6bbda653ef31013 1 parent ad2bb97
@jspahrsummers jspahrsummers authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/UIKit/TUIView+Animation.m
View
7 lib/UIKit/TUIView+Animation.m
@@ -145,6 +145,8 @@ + (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))
+ (void)beginAnimations:(NSString *)animationID context:(void *)context
{
+ [NSAnimationContext beginGrouping];
+
TUIViewAnimation *animation = [[TUIViewAnimation alloc] init];
animation.context = context;
animation.animationID = animationID;
@@ -160,6 +162,7 @@ + (void)beginAnimations:(NSString *)animationID context:(void *)context
+ (void)commitAnimations
{
[[self _animationStack] removeLastObject];
+ [NSAnimationContext endGrouping];
// NSLog(@"--- %d", [[self _animationStack] count]);
}
@@ -188,7 +191,9 @@ static CGFloat SlomoTime()
+ (void)setAnimationDuration:(NSTimeInterval)duration
{
- [self _currentAnimation].basicAnimation.duration = duration * SlomoTime();
+ duration *= SlomoTime();
+ [self _currentAnimation].basicAnimation.duration = duration;
+ [NSAnimationContext currentContext].duration = duration;
}
+ (void)setAnimationDelay:(NSTimeInterval)delay // default = 0.0

0 comments on commit 585ca4a

Please sign in to comment.
Something went wrong with that request. Please try again.