[](https://travis-ci.org/Pete Smith/SafeArray)
SafeArray is a wrapper on a Swift Array which provides thread-safe access to it's underlying Array elements.
Thread-safe versions Array/Collection methods such as append, map are provided.
let safeArray = SafeArray<Int>(withElements: [1,2,3]])
var safeArray = SafeArray<Int>(withElements: [1,2,3]])
safeArray.append(contentsOf: [4,5])
let safeArray = SafeArray<String>(withElements: ["world1","world2"])
let mappedArray = safeArray.map { "Hello "+$0 }
let safeArray = SafeArray<Int>(withElements: [1,2,3])
let filteredArray = safeArray.filter { $0 != 1 }
iOS 9
SafeArray is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SafeArray"
Pete Smith, [email protected]
SafeArray is available under the MIT license. See the LICENSE file for more info.