-
-
Save sturdysturge/5bd8a5bfcaa103bfeb8bc8245ea02cee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import LocalConsole | |
var runningForPreviews: Bool { | |
#if targetEnvironment(simulator) | |
ProcessInfo.processInfo | |
.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" | |
#else | |
return false | |
#endif | |
} | |
func print(_ items: Any..., separator: String = " ") { | |
let joined = items | |
.map { String(describing: $0) } | |
.joined(separator: separator) | |
if runningForPreviews { | |
console.print(joined) | |
} else { | |
Swift.print(joined) | |
} | |
} | |
var console: LCManager { | |
LocalConsole.LCManager.shared | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment