Skip to content

Instantly share code, notes, and snippets.

@orta
Created August 11, 2014 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orta/62f5da1dfec4376d91b9 to your computer and use it in GitHub Desktop.
Save orta/62f5da1dfec4376d91b9 to your computer and use it in GitHub Desktop.
//
// UIViewController+PresentWithFrame.m
// Artsy
//
// Created by Orta on 8/8/14.
// Copyright (c) 2014 Artsy. All rights reserved.
//
#import "UIViewController+PresentWithFrame.h"
@implementation UIViewController (PresentWithFrame)
- (void)ar_presentWithFrame:(CGRect)frame
{
SEL animates = NSSelectorFromString(@"shouldAnimate:");
if ([self respondsToSelector:animates]) {
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[(id)self performSelector:animates withObject:@(NO)];
# pragma clang diagnostic pop
}
[self beginAppearanceTransition:YES animated:NO];
self.view.frame = frame;
[self endAppearanceTransition];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment