Swift -Ounchecked and Assertions
问题 Preface In Swift, ENABLE_NS_ASSERTIONS is ignored, and whether assertions are on or off is dependent of SWIFT_OPTIMIZATION_LEVEL , see here for more information. assert() is active for -Onone assertionFailure() is active for -Onone precondition() is active for -Onone and -O preconditionFailure() is active for -Onone , -O and -Ounchecked fatalError() is active for -Onone , -O and -Ounchecked What I want to achieve Debug and Beta Builds should have assertions enabled , Release Builds should