Does anyone know how you detect from within your code if you're running inside an App Extension?
I have an app which shares classes between an app and an extension. The app code uses [UIApplication sharedApplication]
but this isn't available from within an extension, so it won't compile saying:
'sharedApplication' is unavailable: not available iOS (App Extension)
So I need a way to detect that I'm in the extension and use an alternative to sharedApplication
if that's the case.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…