SafeCollection

3.1.0

Safe Collection for Swift
devxoul/SafeCollection

What's New

3.1.0

2019-04-03T13:04:40Z
  • Add Swift 5 support 🚀 (#5)

SafeCollection

Swift Build Status CocoaPods Carthage compatible

SafeCollection provides a safer way to deal with subscripts. Inspired by Swift's LazyCollection.

At a Glance

let arr = ["A", "B", "C"]

arr[0]    // "A"
arr[100]  // fatal error: Array index out of range 😟

arr.safe[0]   // Optional("A")
arr.safe[100] // nil 😄

Installation

  • For iOS 8+ projects with CocoaPods:

    pod 'SafeCollection'
  • For iOS 8+ projects with Carthage:

    github "devxoul/SafeCollection"
    
  • Using Swift Package Manager:

    import PackageDescription
    
    let package = Package(
      name: "MyAwesomeApp",
      dependencies: [
        .package(url: "https://github.com/devxoul/SafeCollection", .upToNextMajor(from: "3.0.0")),
      ]
    )

License

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

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Aug 29 2022 06:57:43 GMT-0500 (GMT-05:00)