Two Xcode 9 playgrounds written in Swift 4 that highlight protocol oriented programming and value semantics.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Generic List.playground
Protocol Polymorphism.playground
.gitignore
LICENSE.md
README.md

README.md

Protocol Oriented Programming in Swift, Part 1 of 2

Here are two Xcode 9 playgrounds written in Swift 4 that highlight protocol oriented programming and value semantics.

Protocol Polymorphism.playground demonstrates polymorphism inherent in Swift's protocols.

Generic List.playground shows you how to build generic data structures in Swift -- a queue and a stack that can contain any type. It also demonstrates how you can build powerful protocols by inheriting from other ones without the interference you'd get from class inheritance.