Xcode: TEST vs DEBUG preprocessor macros

后端 未结 11 898
余生分开走
余生分开走 2020-11-28 06:24

When creating a new project with unit tests, Xcode sets the build configuration to Debug for the Test scheme (same for the Run scheme).

Should I differentiate betwee

11条回答
  •  感情败类
    2020-11-28 06:51

    Robert's answer in SWIFT 3.0:

    func isRunningTests() -> Bool {
        let environment = ProcessInfo().environment
        return (environment["XCInjectBundleInto"] != nil);
    }
    

提交回复
热议问题