Skip to content

Commit

Permalink
Cleaned up & smoothed out the pop style animation.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismiles committed May 9, 2011
1 parent 8b93a00 commit d98fa9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMPopTipView/CMPopTipView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CMPopTipView.h
//
// Created by Chris Miles on 18/07/10.
// Copyright (c) Chris Miles 2010.
// Copyright (c) Chris Miles 2010-2011.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions CMPopTipView/CMPopTipView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CMPopTipView.m
//
// Created by Chris Miles on 18/07/10.
// Copyright (c) Chris Miles 2010.
// Copyright (c) Chris Miles 2010-2011.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -27,8 +27,6 @@

@interface CMPopTipView ()
@property (nonatomic, retain, readwrite) id targetObject;

- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;
@end


Expand Down Expand Up @@ -295,9 +293,9 @@ - (void)presentPointingAtView:(UIView *)targetView inView:(UIView *)containerVie
// animate to a bigger size
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[UIView setAnimationDidStopSelector:@selector(popAnimationDidStop:finished:context:)];
[UIView setAnimationDuration:0.15f];
self.transform = CGAffineTransformMakeScale(1.3f, 1.3f);
self.transform = CGAffineTransformMakeScale(1.1f, 1.1f);
self.alpha = 1.0;
[UIView commitAnimations];
}
Expand Down Expand Up @@ -376,10 +374,12 @@ -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
}
}

- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
- (void)popAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
// at the end set to normal size
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.1f];
self.transform = CGAffineTransformIdentity;
[UIView commitAnimations];
}

- (id)initWithFrame:(CGRect)frame {
Expand Down

0 comments on commit d98fa9d

Please sign in to comment.