Skip to content

iosbrain/Protocol-Oriented-Programming-in-Swift-1

Repository files navigation

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.