Permalink
Browse files

Naming/formatting tweaks to match existing code style.

  • Loading branch information...
1 parent be124a9 commit 1b77a409a2865445b311ac438c27d036c5df66e3 @nfarina committed Sep 25, 2012
Showing with 7 additions and 10 deletions.
  1. +2 −2 SMCalloutView.h
  2. +5 −8 SMCalloutView.m
View
@@ -59,8 +59,8 @@ extern NSTimeInterval kSMCalloutViewRepositionDelayForUIScrollView;
// calling [UIScrollView setContentOffset:animated:].
- (NSTimeInterval)calloutView:(SMCalloutView *)calloutView delayForRepositionWithSize:(CGSize)offset;
-// Called when showing animation is finished
-- (void)calloutViewDidShow:(SMCalloutView *)calloutView;
+// Called after the callout view appears on screen, or after the appearance animation is complete.
+- (void)calloutViewDidAppear:(SMCalloutView *)calloutView;
@end
View
@@ -264,7 +264,7 @@ - (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToV
bounceAnimation.beginTime = CACurrentMediaTime() + delay;
bounceAnimation.values = @[@0.05, @1.11245, @0.951807, @1.0];
bounceAnimation.keyTimes = @[@0, @(4.0/9.0), @(4.0/9.0+5.0/18.0), @1.0];
- bounceAnimation.duration = animated ? BOUNCE_ANIMATION_DURATION : 0;
+ bounceAnimation.duration = animated ? BOUNCE_ANIMATION_DURATION : 0.0000001; // can't be zero or the animation won't "run"
bounceAnimation.timingFunctions = @[easeInOut, easeInOut, easeInOut, easeInOut];
bounceAnimation.delegate = self;
@@ -276,13 +276,10 @@ - (void)animationDidStart:(CAAnimation *)anim {
self.hidden = NO;
}
-- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
- if (flag){
- if ([_delegate respondsToSelector:@selector(calloutViewDidShow:)]){
- [_delegate calloutViewDidShow:self];
- }
- }
-
+- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)finished {
+ if (finished)
+ if ([_delegate respondsToSelector:@selector(calloutViewDidAppear:)])
+ [_delegate calloutViewDidAppear:self];
}
- (void)dismissCalloutAnimated:(BOOL)animated {

0 comments on commit 1b77a40

Please sign in to comment.