Skip to content

Instantly share code, notes, and snippets.

@vhart
Last active November 28, 2016 17:16
Show Gist options
  • Save vhart/0dfa95e73117955d09de5ed5973e2a6e to your computer and use it in GitHub Desktop.
Save vhart/0dfa95e73117955d09de5ed5973e2a6e to your computer and use it in GitHub Desktop.
Protocol-Generics Pt 1
protocol Drivable {
func drive()
var numberOfWheels: Int { get }
}
func startTraveling(with transportation: Drivable) { }
func startTraveling<D: Drivable>(with transportation: D) { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment