Instantly share code, notes, and snippets.

Embed
What would you like to do?
func assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String) {
if condition() {
print(message())
}
}
func conditionOne() -> Bool {
return true
}
func phrase() -> String {
return "Text"
}
assert(true, "Hello")
assert(false, "Good bye")
assert(conditionOne(), phrase())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment