Pattern: Use of assert(false)
Issue: -
Prefer assertionFailure()
and/or preconditionFailure()
over assert(false)
.
Examples of correct code:
assert(true)
assert(true, "foobar")
assert(true, "foobar", file: "toto", line: 42)
assert(false || true)
XCTAssert(false)
Examples of incorrect code:
↓assert(false)
↓assert(false, "foobar")
↓assert(false, "foobar", file: "toto", line: 42)
↓assert( false , "foobar")