Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* syntax:
- public func preconditionFailure(
- _ message: @autoclosure () -> String = default,
- file: StaticString = #file,
- line: UInt = #line) -> Never
- */
- func validateAge(age: Int) -> Bool {
- guard age >= 3 else {
- preconditionFailure("Age can't be less than 3")
- }
- return true
- }
- _ = validateAge(age: 2)
Add Comment
Please, Sign In to add comment