One annoying thing when running tests in Xcode 6.1 is that the entire app has to run and launch its storyboard and root view controller. In my app this runs some server calls th
Combined approach of @Jessy and @Michael McGuire
(As accepted answer will not help you while developing a framework)
So here is the code:
#if DEBUG if (NSClassFromString(@"XCTest") == nil) { // Your code that shouldn't run under tests } #else // unconditional Release version #endif