Skip to content

Instantly share code, notes, and snippets.

@novinfard
Created February 1, 2019 13:44
Show Gist options
  • Save novinfard/cfb2553f61f420af6d5c3c39b623a290 to your computer and use it in GitHub Desktop.
Save novinfard/cfb2553f61f420af6d5c3c39b623a290 to your computer and use it in GitHub Desktop.
[Different level of error asserting in swift and corresponding result]
debug release release
function -Onone -O -Ounchecked
assert() YES NO NO
assertionFailure() YES NO NO**
precondition() YES YES NO
preconditionFailure() YES YES YES**
fatalError()* YES YES YES
– assert: checking your own code for internal errors
– precondition: for checking that your clients have given you valid arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment