๐คCompiler Directives
Compilation Condition: #if
#if DEBUG
#if <compilation flag> ๐ Feature flags in Swift
#if targetEnvironment( )
func log(_ expression: @autoclosure () -> Any) {
// print a given expression only within debug builds
#if DEBUG
print(expression())
#endif
}
Last updated
Was this helpful?