1

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. enter image description here

UIInterfaceOrientation orientation;

#if !defined(TARGET_IS_EXTENSION)
    orientation = [[UIApplication sharedApplication] statusBarOrientation];
#else
    orientation = UIInterfaceOrientationPortrait;
#endif
user4992124
  • 1,574
  • 1
  • 17
  • 35

0 Answers0