Skip to content

Instantly share code, notes, and snippets.

@leonaka
leonaka / gist:51c1de59b64c863932f0
Created March 25, 2015 18:17
Tumblr- and Tweetbot-like view on top of UIActivityViewController, with appearance animation (put it on a subclass of UIActivityViewController)
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
CGFloat distance = 10.0;
[self.transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[UIView performWithoutAnimation:^{
self.effectView.frame = CGRectMake(0, self.view.frame.size.height - self.effectView.frame.size.height - distance, self.view.frame.size.width, self.effectView.frame.size.height);
}];
self.effectView.frame = CGRectMake(0, -self.effectView.frame.size.height - distance), self.view.frame.size.width, self.effectView.frame.size.height);