Skip to content

Instantly share code, notes, and snippets.

@eito
Created February 25, 2015 03:56
Show Gist options
  • Save eito/fac87597e438a523a6bf to your computer and use it in GitHub Desktop.
Save eito/fac87597e438a523a6bf to your computer and use it in GitHub Desktop.
swift conditional compile
#if DEBUG
println("Debug mode")
#else
println("Release Mode")
#endif
#if false
println("This code will never run")
#endif
#if os(iOS)
println("This is iOS")
#else
println("This is NOT iOS")
#endif
#if arch(x86_64)
println("64 bit simulator")
#elseif arch(i386)
println("32 bit simulator")
#elseif arch(arm)
println("32 bit arm device")
#elseif arch(arm64)
println("64 bit arm device")
#else
println("Unknown device")
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment