Note: DefaultDict is still maintained, but in Swift 4 you might rather use Swift's built in default value feature.
import DefaultDict
let d = DefaultDict<String: String>(value: "default")
print(d["something"]) // prints "default"
d["something"] = "other"
print(d["something"]) // prints "other"
DefaultDict is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'DefaultDict', '~> 1.0.0'
Contributions are welcome! Please open an issue to suggest a feature (you can assign yourself if you intent to implement it).
To run tests, run pod install
on the Example
project and open the example workspace where you'll find the tests.
Noah Gilmore, noahgilmore.com
DefaultDict is available under the MIT license. See the LICENSE file for more info.