Skip to content

Instantly share code, notes, and snippets.

@lucianoschillagi
Created September 12, 2024 22:01
Show Gist options
  • Save lucianoschillagi/6aa230c27fd6649450eb2334c0ebf425 to your computer and use it in GitHub Desktop.
Save lucianoschillagi/6aa230c27fd6649450eb2334c0ebf425 to your computer and use it in GitHub Desktop.
precondition method
import Foundation
// Swift Standard Library - Exploring its methods!
// The 'precondition' method.
let faceWithSunglasses: Character = "πŸ™‚"
//let faceWithSunglasses: Character = "😎"
// if this precondition is not true, the program will be interrupted
precondition(faceWithSunglasses == "😎",
"Please put it your sunglasses")
print(faceWithSunglasses)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment