Permalink
Browse files

added presentVC: helper method to present vc modally handling depreca…

…tion of presentModalViewController:animated: method.
  • Loading branch information...
1 parent 667d6e1 commit b3155301e3373631ca92531196a0a3df42576f2a @ettore committed Jan 24, 2013
Showing with 38 additions and 0 deletions.
  1. +14 −0 categories/CLCGUIViewControllerCategory.h
  2. +24 −0 categories/CLCGUIViewControllerCategory.m
@@ -0,0 +1,14 @@
+//
+// CLCGUIViewControllerCategory.h
+// Created by Ettore Pasquini on 1/23/13.
+//
+
+@interface UIViewController (Candygirl)
+
+/*!
+ Present view controller modally with animation and no completion handler.
+ Handles deprecation of presentModalViewController:animated: deprecation.
+ */
+-(void)presentVC:(UIViewController*)vc;
+
+@end
@@ -0,0 +1,24 @@
+//
+// CLCGUIViewControllerCategory.m
+// Goodreads
+// Created by Ettore Pasquini on 1/23/13.
+//
+
+#import "clcg_device_utils.h"
+#import "CLCGUIViewControllerCategory.h"
+
+
+@implementation UIViewController (Candygirl)
+
+
+-(void)presentVC:(UIViewController*)vc
+{
+ if (clcg_os_geq(@"5.0")) {
+ [self presentViewController:vc animated:YES completion:nil];
+ } else {
+ [self presentModalViewController:vc animated:YES];
+ }
+}
+
+
+@end

0 comments on commit b315530

Please sign in to comment.