Skip to content

Instantly share code, notes, and snippets.

@evgeniyd
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evgeniyd/64ed7a74a62f9fbc7509 to your computer and use it in GitHub Desktop.
Save evgeniyd/64ed7a74a62f9fbc7509 to your computer and use it in GitHub Desktop.
Override += operator to append a Dictionary with values and keys from another Dictionary
import Foundation
func += <KeyType, ValueType> (inout left: Dictionary<KeyType, ValueType>, right: Dictionary<KeyType, ValueType>) {
for (k, v) in right {
left.updateValue(v, forKey: k)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment