I\'m running into a strange problem that I haven\'t run into before.
When you do cmd+U to run your Unit Tests (OCUnit for example) does it actually call the main.m,
In Swift, I prefere to bypass a normal execution path inside application: didFinishLaunchingWithOptions:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
guard normalExecutionPath() else {
window = nil
return false
}
// regular setup
return true
}
private func normalExecutionPath() -> Bool {
return NSClassFromString("XCTestCase") == nil
}
Code inside guard will remove any views created from storyboard.