Swift 4 Protocol-Oriented Programming - Third Edition: Bring predictability, performance, and productivity to your Swift applications by Jon Hoffman

Swift 4 Protocol-Oriented Programming - Third Edition: Bring predictability, performance, and productivity to your Swift applications by Jon Hoffman

Author:Jon Hoffman [Hoffman, Jon]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2017-10-06T04:00:00+00:00


This diagram shows that the ArrayList type conforms to the List protocol and uses the BackEndList type. Now we can very easily add other types that conform to the List protocol and if they are implemented as a value type, we can also use the same BackEndList type to implement the COW feature. The following diagram illustrates this:

Now that we have seen how to design a basic data structure in a protocol oriented way with generics, let's look at how generics are used in the Swift standard library.

Generics in the Swift standard library



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.