This question is based purely on publicly released documents regarding the introduction of application extensions in iOS.
With the introduction of app extensions in iOS
You can use the same technique than Apple uses for raising the compilation error.
#if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension)) //Not in the extension #else //In extension #end