This library defines a new postfix operator, ⁉, for Swift. It behaves like the the normal force unwrap operator(!) but instead of crashing your application, it throws an error.
let optionalString: String? = "Cheese"
let nonOptionalString: String = try optionalString⁉
AlmostForceUnwrap
Throwing force unwrap operator for Swift
This library defines a new postfix operator,
⁉
, for Swift. It behaves like the the normal force unwrap operator(!
) but instead of crashing your application, it throws an error.Usage
Use the Swift Package Manager:
Import it:
Now you can use the operator yourself.