Permalink
Browse files

Add IOCExtensions for UIViewController

  • Loading branch information...
1 parent 0b69a73 commit 2381bf3ee61d777e7c5883cbbb153cb5d1fa9e73 @dennisreimann committed Jun 20, 2013
@@ -0,0 +1,14 @@
+//
+// UIViewController_IOCExtensions.h
+// iOctocat
+//
+// Created by Dennis Reimann on 06/20/13.
+// http://dennisreimann.de
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface UIViewController (IOCExtensions)
+- (BOOL)ioc_isBeingPopped;
+@end
@@ -0,0 +1,20 @@
+//
+// UIViewController_IOCExtensions.m
+// iOctocat
+//
+// Created by Dennis Reimann on 06/20/13.
+// http://dennisreimann.de
+//
+
+#import "UIViewController_IOCExtensions.h"
+
+
+@implementation UIViewController (IOCExtensions)
+
+- (BOOL)ioc_isBeingPopped {
+ if (!self.navigationController) return NO;
+ NSArray *viewControllers = self.navigationController.viewControllers;
+ return [viewControllers indexOfObject:self] == NSNotFound;
+}
+
+@end

0 comments on commit 2381bf3

Please sign in to comment.