Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension Dictionary {
- mutating func merge(with dictionary: Dictionary) {
- dictionary.forEach { updateValue($1, forKey: $0) }
- }
- func merged(with dictionary: Dictionary) -> Dictionary {
- var dict = self
- dictionary.forEach { dict.updateValue($1, forKey: $0) }
- return dict
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment