Does anyone know how you detect from within your code if you're running inside an iOS 8 Extension.
I have an app which shares classes between an app and an extension. The app code uses
'sharedApplication' is unavailable: not available iOS (App Extension)
You can use a preprocessor macro:
In the project settings use the dropdown in the topbar to select your extension target:
- Find (or search)
Apple LLVM 6.0 - Preprocessing
TARGET_IS_EXTENSIONor any other name of your choice in both the debug and release sections.
Then in your code:
#ifndef TARGET_IS_EXTENSION // if it's not defined // Do your calls to UIApplication #endif