No Description

DictionaryExt.swift 513B

1234567891011121314151617181920212223242526
  1. //
  2. // DictionaryExt.swift
  3. // PaiaiDataKit
  4. //
  5. // Created by FFIB on 2018/12/28.
  6. // Copyright © 2018 FFIB. All rights reserved.
  7. //
  8. import Foundation
  9. extension Dictionary {
  10. static func += (_ lhs: inout Dictionary, _ rhs: Dictionary) {
  11. for (key, val) in rhs {
  12. lhs[key] = val
  13. }
  14. }
  15. static func + (_ lhs: Dictionary, _ rhs: Dictionary) -> Dictionary {
  16. var dict = lhs
  17. for (key, val) in rhs {
  18. dict[key] = val
  19. }
  20. return dict
  21. }
  22. }