GitXplorerGitXplorer
c

ConditionalSet

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
6092216315089acd587ded9f479d8742cf8d9a8b

made public

ccoryalder committed 9 years ago
Unverified
6567c0e2df8291a0b4361e27ee7cac0ad6e191a7

Initial commit

ccoryalder committed 9 years ago

README

The README file for this repository.

ConditionalSet

Set a dictionary key using an optional. If the optional exists, the key will be set, if the optional is nil, the key will not be set.

Usage

import ConditionalSet

var dict: [String: String] = [:]

var maybeString: String? = nil

dict.set("win", maybeString)
// => [:]

// now make maybeString not nil
maybeString = "win!"

dict.set("win", maybeString)
// => ["win" : "win!"]

Installation

Swift Package Manager

Add Later to your Package.swift file:

import PackageDescription

let package = Package(
    name: "YourPackageName",
    dependencies: [
        .Package(url: "https://github.com/coryalder/ConditionalSet.git", majorVersion: 0),
    ]
)