Summary
In this chapter we covered changes to collections and closures. We learned about the new Collection protocol that forms the base of the new collection model and how to adopt the protocol in our own custom collections. The new collection model made a significant change in moving collection traversal from the index to the collection itself. The new collection model changes are necessary in order to support Objective-C interactivity and to provide a mechanism to iterate over the collections items using the collections itself. As for closures, we also explored the motivation for the language moving to non-escaping closures as the default. We also learned how to properly use inout
parameters with closures in Swift 3. In the next chapter, we are will cover more type changes and type aliases within protocols and protocol extensions.