Skip to content

Instantly share code, notes, and snippets.

@stoeckley
Created December 18, 2017 09:25
Show Gist options
  • Save stoeckley/610d5c7916c373d0ef693ec97d993fe7 to your computer and use it in GitHub Desktop.
Save stoeckley/610d5c7916c373d0ef693ec97d993fe7 to your computer and use it in GitHub Desktop.
Swift debug printing
#if !DEBUG
public func print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
//does nothing if not in debug build
}
#else
public func print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
debugPrint(items)
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment