Fallback 0.2.0

Fallback 0.2.0

DocsDocumented
TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2016
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Suyeol Jeon.


Downloads

Total10
Week0
Month0

Installs

Apps1
Test Targets1
powered by Segment

GitHub

Stars30
Watchers2
Forks2
Issues0
Contributors1
Pull Requests1

Code

Files1
SizeIntegration Size 12 kb
FrameworkCreates Framework
LOCLines of Code 38


Fallback 0.2.0

  • By
  • Suyeol Jeon

Fallback

Syntactic sugar for Swift do-try-catch.

At a Glance

value = try fallback(
  try get("A"),
  try get("B"),
  try get("C"),
  try get("D")
)

is equivalent to:

do {
  value = try get("A")
} catch {
  do {
    value = try get("B")
  } catch {
    do {
      value = try get("C")
    } catch {
      value = try get("D")
    }
  }
}

Installation

  • Using CocoaPods:

    pod 'Fallback', '~> 0.1'
  • Using Carthage:

    github "devxoul/Fallback" ~> 0.1
    
  • Using Swift Package Manager:

    import PackageDescription
    
    let package = Package(
      name: "MyAwesomeProject",
      targets: [],
      dependencies: [
        .Package(url: "https://github.com/devxoul/Fallback.git", majorVersion: 0)
      ]
    )

License

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