Swiftpack.co - Pelagornis/OBExtensions as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Pelagornis.
Pelagornis/OBExtensions 1.2.4
Library for more convenient optional binding
⭐️ 0
🕓 3 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/Pelagornis/OBExtensions.git", from: "1.2.4")

OBExtensions

Swift

⚒ Library for more convenient optional binding.

Using

import

import OBExtensions

Use

Before

var string: String?
guard let s = string else { return "" }

After

var string: String?
let s = string.obe(error: { return "" })

and

Before

if let s = string { 
    print("string :: \(s)") 
} else {
    fatalError()
}

After

let s = string.obe { print("string :: \($0)") }

Installation

pod 'OBExtensions'
import PackageDescription

let package = Package(
  name: "MyApp",
  dependencies: [
    .Package(url: "https://github.com/Pelagornis/OBExtensions", branch: "main"),
 ]
)

License

OBExtensions is under MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 0
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Version 1.2.4
7 weeks ago

Cocoapods not Supporting

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics