Skip to content

Instantly share code, notes, and snippets.

@g-1
Created August 23, 2014 15:19
Show Gist options
  • Save g-1/b23c2c25707d94eb8dde to your computer and use it in GitHub Desktop.
Save g-1/b23c2c25707d94eb8dde to your computer and use it in GitHub Desktop.
iOSでポップアップビューの自作を行う。 ref: http://qiita.com/g-1/items/bbf785e32bdfb66eb714
- (IBAction)close:(id)sender
{
[UIView animateWithDuration:0.2f
animations:^{
self.view.alpha = 0.2f;
}
completion:^(BOOL finished){
[self.view removeFromSuperview];
self.view.alpha = 1.f;
}];
}
- (IBAction)popup:(id)sender
{
[self.view addSubview:self.popupViewController.view];
CGPoint center = self.popupViewController.contentView.center;
UIView* view = self.popupViewController.contentView;
view.transform = CGAffineTransformScale(CGAffineTransformIdentity,0.5f,0.5f);
view.center = center;
[UIView animateWithDuration:0.2
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
view.transform = CGAffineTransformIdentity;
view.center = center;
}
completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment