Skip to content

Instantly share code, notes, and snippets.

@Alexander-Ignition
Last active July 30, 2019 11:57
Show Gist options
  • Save Alexander-Ignition/6878830bb7fefe718d219d52ec73f574 to your computer and use it in GitHub Desktop.
Save Alexander-Ignition/6878830bb7fefe718d219d52ec73f574 to your computer and use it in GitHub Desktop.
Swift Asserts

Swift Asserts

Function name Condition In playgrounds and -Onone builds (the default for Xcode's Debug configuration) In -O builds (the default for Xcode's Release configuration) In -Ounchecked builds
assert πŸ”˜ πŸ”˜ βšͺ βšͺ
assertionFailure βšͺ πŸ”˜ βšͺ βšͺ
precondition πŸ”˜ πŸ”˜ πŸ”˜ βšͺ
preconditionFailure βšͺ πŸ”˜ πŸ”˜ βšͺ
fatalError βšͺ πŸ”˜ πŸ”˜ πŸ”˜
dispatchPrecondition πŸ”˜ πŸ”˜ πŸ”˜ βšͺ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment