Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 391 Bytes

File metadata and controls

22 lines (16 loc) · 391 Bytes

Common

Meant for library internal stuff:

  • Swift 4 & 4.2 support code.
  • Require

Require

Useful for replacing this:

guard let value = someValue else {
  fatalError("Missing someValue in ...")
}

With this:

let value = someValue.require("Missing someValue in ...")

Note: Only use this very sparingly! It's essentially a force unwrap with a nice message.