I am using SimulatorStatusMagic to change the status bar within the simulator when automating my screenshots. I cannot include this within non-screenshot builds due to the code not working on devices and using private APIs, restricting a submission to the app store. The project files are included directly in the project, without the use of a framework, due to the app targeting iOS 7.
Within the Objective-C Bridging Header I have:
#ifdef SNAPSHOT
#import "SDStatusBarManager.h"
#endif
I then have a separate release name "snapshot", which has the follow values:
Preprocessor Macros: SNAPSHOT=1
Other Swift Flags: -D SNAPSHOT
Within my app delegate I then have:
#if SNAPSHOT
SDStatusBarManager.sharedInstance().enableOverrides()
#endif
I (incorrectly) thought that this would allow me to submit to the app store since the code would not be compiled but I was wrong. Is there a way to only have this code included in snapshot builds?