Last active
December 30, 2015 20:19
-
-
Save psy2k/7879547 to your computer and use it in GitHub Desktop.
Fade in of the PopUpViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showAnimate | |
{ | |
self.view.transform = CGAffineTransformMakeScale(1.3, 1.3); | |
self.view.alpha = 0; | |
[UIView animateWithDuration:.25 animations:^{ | |
self.view.alpha = 1; | |
self.view.transform = CGAffineTransformMakeScale(1, 1); | |
}]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)removeAnimate | |
{ | |
[UIView animateWithDuration:.25 animations:^{ | |
self.view.transform = CGAffineTransformMakeScale(1.3, 1.3); | |
self.view.alpha = 0.0; | |
} completion:^(BOOL finished) { | |
if (finished) { | |
[self.view removeFromSuperview]; | |
} | |
}]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showInView:(UIView *)aView animated:(BOOL)animated | |
{ | |
[aView addSubview:self.view]; | |
if (animated) { | |
[self showAnimate]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import <QuartzCore/QuartzCore.h> | |
#import "AppDelegate.h" | |
@interface PopUpViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet UIView *popUpView; | |
- (void)showInView:(UIView *)aView animated:(BOOL)animated; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment