Latest 2.0.0
Homepage https://github.com/dclelland/Parity
License MIT
Platforms ios 8.0, requires ARC
Authors

Parity is an integer parity microlibrary. It tells you whether an integer is even or odd!

Examples

✓ Helpers


2.isEven
// true

3.isOdd
// true

✓ Helpful enum for code readability:


// Before:
if (number % 2 == 0) {
    print("even")
} else {
    print("odd")
}

// After:
switch number.parity {
    case .even:
        print("even")
    case .odd:
        print("odd")
}

// Before:
if (numberA % 2 == numberB % 2) {
    print("both numbers have the same parity")
}

// After:
if (numberA.parity == numberB.parity) {
    print("both numbers have the same parity")
}

Latest podspec

{
    "name": "Parity",
    "version": "2.0.0",
    "summary": "An integer parity microlibrary.",
    "homepage": "https://github.com/dclelland/Parity",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Daniel Clelland": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dclelland/Parity.git",
        "tag": "2.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "ios": {
        "source_files": "Parity.swift"
    },
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This