Latest 2.0.0
Homepage https://github.com/devxoul/SafeIndex
License MIT
Platforms ios 8.0, osx 10.9, tvos 9.0, requires ARC
Authors

Swift
Build Status
CocoaPods
Carthage compatible

Optional Index for Swift.

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 'SafeIndex'
  • For iOS 8+ projects with Carthage:

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

    import PackageDescription
    
    let package = Package(
      name: "MyAwesomeApp",
      dependencies: [
        .package(url: "https://github.com/devxoul/SafeIndex", "1.0.0"),
      ]
    )

License

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

Latest podspec

{
    "name": "SafeIndex",
    "version": "2.0.0",
    "summary": "Optional Index for Swift",
    "homepage": "https://github.com/devxoul/SafeIndex",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Suyeol Jeon": "[email protected]"
    },
    "source": {
        "git": "https://github.com/devxoul/SafeIndex.git",
        "tag": "2.0.0"
    },
    "source_files": "Sources/**/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0"
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This