Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Dictionary for Swift4

3,219 views

Published on

WWDC - Developer's Living

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Dictionary for Swift4

  1. 1. Swift4
  2. 2. Codable?
  3. 3. Dictionary!
  4. 4. Dictionary of Swift 4 Hanawa Takuro LIFULL Co., Ltd.
  5. 5. !Hanawa Takuro facebook.com/takuro.hanawa 🏢LIFULL Co.,Ltd. iOS Engineer Music - Diggin’/ WWDC
  6. 6. Agenda • Initialization for Sequence • Duplicate Key • Filter and Map • Default Values • Grouping • Reserving Capacity
  7. 7. Initialization for Sequence
  8. 8. init(uniqueKeysWithValues:) • Key-Value Sequence Dictionary 👏
  9. 9. init(uniqueKeysWithValues:) • Key-Value
  10. 10. • Swift3 zip 💪 init(uniqueKeysWithValues:)
  11. 11. Duplicate Key
  12. 12. init(_:uniquingKeysWith:) • Key ⚠
  13. 13. init(_:uniquingKeysWith:) • Key Key Value 👏 Amazing.
  14. 14. merging(_:uniquingKeysWith:) • Dictionary merging merge(mutating)
  15. 15. Filter and Map
  16. 16. filter(_:) • Collection filter
  17. 17. filter(_:) • Dictionary Dictionary filter 👏
  18. 18. mapValues(_:) • Dictionary Value Dictionary 🤔
  19. 19. mapValues(_:) • Dictionary Value Value Dictionary 👏 Awesome.
  20. 20. Default Values
  21. 21. subscript(_:default:) • Value Non-Optional ”??” (Nil Coalescing Operator) 🤔
  22. 22. subscript(_:default:) • Key Value
  23. 23. subscript(_:default:) • += Value 😭
  24. 24. subscript(_:default:) Sweet.
  25. 25. Grouping
  26. 26. init(grouping:by:) • Dictionary 🤔
  27. 27. init(grouping:by:) • Sequence Key Dictionary 👏 Dude.
  28. 28. Reserving Capacity
  29. 29. init(grouping:by:) • Dictionary 👏
  30. 30. Conclusion • Key-Value Sequence • Key • Filter Map(Value) • • Sequence •

×