Created
August 11, 2014 17:28
-
-
Save orta/62f5da1dfec4376d91b9 to your computer and use it in GitHub Desktop.
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
// | |
// 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