AlmostForceUnwrap

1.0.0

Throwing force unwrap operator for Swift
Obbut/AlmostForceUnwrap

What's New

2018-09-14T13:47:53Z

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.

let optionalString: String? = "Cheese"
let nonOptionalString: String = try optionalStringā‰

Usage

Use the Swift Package Manager:

import PackageDescription

let package = Package(
    name: "MyApp",
    dependencies: [
        .Package(url: "https://github.com/Obbut/AlmostForceUnwrap.git", majorVersion: 0, minor: 1)
    ]
)

Import it:

import AlmostForceUnwrap

Now you can use the operator yourself.

Description

  • Swift Tools 4.2.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Dec 22 2023 00:53:11 GMT-1000 (Hawaii-Aleutian Standard Time)