EFSafeArray is an extension to make array subscript safe, nil will be return instead of crash if index is out of range, it works on iOS, macOS, watchOS and tvOS.
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
EFSafeArray is an extension to make array subscript safe, nil will be return instead of crash if index is out of range, it works on
iOS
,macOS
,watchOS
andtvOS
.Example
To run the example project, clone the repo, and run
pod install
from the Example directory first.Requirements
Swift 3.0+
iOS 8.0+
Swift 4.0+
iOS 8.0+
Swift 5.0+
iOS 8.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
Installation
CocoaPods
EFSafeArray is available through CocoaPods. To install it, simply add the following line to your Podfile:
Swift Package Manager
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the Swift compiler.
Once you have your Swift package set up, adding EFSafeArray as a dependency is as easy as adding it to the
dependencies
value of yourPackage.swift
.Use
Author
EyreFree, eyrefree@eyrefree.org
License
EFSafeArray is available under the MIT license. See the LICENSE file for more info.