Skip to content

Instantly share code, notes, and snippets.

@shaps80
Last active August 29, 2015 14:22
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 shaps80/5c222332c23a67c0ad28 to your computer and use it in GitHub Desktop.
Save shaps80/5c222332c23a67c0ad28 to your computer and use it in GitHub Desktop.
Check if running inside an App Extension vs an App
@import Foundation;
@interface UIApplication (SnippexAdditions)
+ (BOOL)isAppExtension;
@end
#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