Skip to content

Instantly share code, notes, and snippets.

@cennydavidsson
Last active October 24, 2015 08:56
Show Gist options
  • Select an option

  • Save cennydavidsson/d489a7d1d183265a09d4 to your computer and use it in GitHub Desktop.

Select an option

Save cennydavidsson/d489a7d1d183265a09d4 to your computer and use it in GitHub Desktop.
struct Superhero: SuperheroType {
let name: String
let secretIdentiy: String
let canFly: Bool
let powerLevel: Int
}
protocol SuperheroType {
var name: String { get }
var secretIdentiy: String { get }
var canFly: Bool { get }
var powerLevel: Int { get }
}
extension SuperheroType {
func flyToLocation(location: Location) {/* implementation */}
func punchVillian(villian: Villian) {/* implementation */}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment