Latest 1.1.0
Homepage https://github.com/lucas34/LazyArray
License MIT
Platforms ios 8.0, tvos 9.0, watchos 2.0, osx 10.9, requires ARC
Authors

Array and list operations made lazy.

swift
travis
codecov
pod
Carthage compatible
codebeat badge

LazyArray is a standalone generic immutable list with O(1) only’s methods.

  • [x] Map: In Swift.Array, map function has a O(n) complexity. In LazyArray, the map will be applied on demande.
  • [x] Cache: Will cache result before returning. Great when you use the map operator

From Swift.Collection

  • [x] Prefix, Suffix
  • [x] first, last
  • [x] dropFirst, dropLast
  • [x] reversed

Note about memory impact

Original array will be wrapped for each operation. Functions that are supposed to modify the LazyArray’s size will not drops the elements from memory.

Installation

Carthage

LazyArray is carthage compatible. Add the following entry in your Cartfile:

github "lucas34/LazyArray"

Then run carthage update.

CocoaPods

You can use CocoaPods to install LazyArray by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'LazyArray'

In your application, simply import the library

import LazyArray

Contributors

We would love you for the contribution to LazyArray, check the LICENSE file for more info.

Licence

Distributed under the MIT license. See LICENSE for more information.

Latest podspec

{
    "name": "LazyArray",
    "version": "1.1.0",
    "summary": "LazyArray",
    "description": "O(1) array operations",
    "homepage": "https://github.com/lucas34/LazyArray",
    "license": "MIT",
    "authors": {
        "Lucas Nelaupe": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lucas34/LazyArray.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0",
        "watchos": "2.0",
        "osx": "10.9"
    },
    "requires_arc": true,
    "source_files": "Sources/LazyArray/**.swift",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This