Latest 1.0.0
Homepage https://github.com/mennolovink/ArrayPlusTuple
License MIT
Platforms ios 8.0
Dependencies InjectableLoggers
Authors

Version Platform License

Simple extension that makes creating tuples from arrays a breeze.

Originally created for Mock ‘N Stub.

Setup

Just add:

import ArrayPlusTuple

to the files where you need tuples from arrays.

Example

Non optional Any:

let tuple = [1, 2, "tree"].tuple

Typed optional:

let tuple = [1, 2, "tree"].tuple as? (Int, Int, String)

Larger arrays

ArrayPlusTuple currently supports creating tuples from arrays with up to 24 elements.

When creating tuples from arrays with more than 24 elements, a warning will be logged and a tuple with the first 24 elements of the array is still returned.

Screenshot Missing

Need support for more elements?

Create a feature request and it will likely be picked up.

Or add it yourself and create a pull request, if the tests pass i’ll merge it.

Author

mennolovink, [email protected]

License

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

Latest podspec

{
    "name": "ArrayPlusTuple",
    "version": "1.0.0",
    "summary": "Simple extension that makes creating tuples from arrays a breeze.",
    "description": "Simple extension that makes creating tuples from arrays a breeze.nOriginally created for MockNStub.",
    "homepage": "https://github.com/mennolovink/ArrayPlusTuple",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "mennolovink": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mennolovink/ArrayPlusTuple.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ArrayPlusTuple/Classes/**/*",
    "dependencies": {
        "InjectableLoggers": [
            "~> 1.2"
        ]
    }
}

Pin It on Pinterest

Share This