Reader small image

You're reading from  Swift 3 New Features

Product typeBook
Published inOct 2016
Reading LevelIntermediate
PublisherPackt
ISBN-139781786469632
Edition1st Edition
Languages
Right arrow
Author (1)
Keith Elliott
Keith Elliott
author image
Keith Elliott

Keith Elliott is a multitalented professional with unique business and technology experience spanning telecommunications, real estate investment banking, and capital markets. His work is driven simply by problems that need solutions, whether the problem is as simple as his wifes request for a custom to-do list or as complex as interest rate derivatives and foreign exchange hedging. He graduated with an MBA from Columbia Business School with an emphasis in entrepreneurship and an undergraduate degree from Georgia Institute of Technology with a bachelor's in computer engineering. Keith's own company, GittieLabs LLC, works with startups to provide technology solutions. His vision is to equip students with the real-life experience necessary to succeed in startup and corporate life. You can find his blog on the GittieLabs LLC website, www.gittie.com. On nights and weekends, Keith can be found spending time with his family, riding motorcycles with his lovely wife, watching football, and rewatching countless hours of WWDC videos.
Read more about Keith Elliott

Right arrow

Collection and sequence type changes


Let's begin our discussion with Swift 3 changes to Collection and Sequence types. Some of the changes are subtle and others are bound to require a decent amount of refactoring to your custom implementations. Swift provides three main collection types for warehousing your values: arrays, dictionaries, and sets. Arrays allow you to store values in an ordered list. Dictionaries provide unordered key-value storage for your data. Finally, sets provide an unordered list of unique values (that is, no duplicates allowed).

Lazy FlatMap for sequence of optional [SE-0008]

Arrays, dictionaries, and sets are implemented as generic types in Swift. They each implement the new Collection protocol, which implements the Sequence protocol. Along this path from top-level type to Sequence protocol, you will find various other protocols that are also implemented in this inheritance chain. For our discussion on flatMap and lazy flatMap changes, I want to focus on Sequences.

Sequences...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Swift 3 New Features
Published in: Oct 2016Publisher: PacktISBN-13: 9781786469632

Author (1)

author image
Keith Elliott

Keith Elliott is a multitalented professional with unique business and technology experience spanning telecommunications, real estate investment banking, and capital markets. His work is driven simply by problems that need solutions, whether the problem is as simple as his wifes request for a custom to-do list or as complex as interest rate derivatives and foreign exchange hedging. He graduated with an MBA from Columbia Business School with an emphasis in entrepreneurship and an undergraduate degree from Georgia Institute of Technology with a bachelor's in computer engineering. Keith's own company, GittieLabs LLC, works with startups to provide technology solutions. His vision is to equip students with the real-life experience necessary to succeed in startup and corporate life. You can find his blog on the GittieLabs LLC website, www.gittie.com. On nights and weekends, Keith can be found spending time with his family, riding motorcycles with his lovely wife, watching football, and rewatching countless hours of WWDC videos.
Read more about Keith Elliott