Last active
August 29, 2015 14:22
-
-
Save shaps80/5c222332c23a67c0ad28 to your computer and use it in GitHub Desktop.
Check if running inside an App Extension vs an App
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
@import Foundation; | |
@interface UIApplication (SnippexAdditions) | |
+ (BOOL)isAppExtension; | |
@end |
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
#import "UIApplication+SnippexAdditions.h" | |
@implementation UIApplication (SnippexAdditions) | |
+ (BOOL)isAppExtension | |
{ | |
return ([[NSBundle mainBundle].executablePath rangeOfString:@".appex"].location != NSNotFound); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment