I'm having some trouble with my iOS extension. My library uses [[UIApplication sharedApplication] statusBarOrientation]
to detect the orientation. sharedApplication
isn't available in an iOS extension, so I thought I'd use a macro. It keeps throwing sharedApplication is unavailable
though. What am I doing wrong? As you can see I have set the macro correctly.
UIInterfaceOrientation orientation;
#if !defined(TARGET_IS_EXTENSION)
orientation = [[UIApplication sharedApplication] statusBarOrientation];
#else
orientation = UIInterfaceOrientationPortrait;
#endif