Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Last active January 11, 2018 07:05
Show Gist options
  • Save agoiabel/2517f867b0b2521da903996cb160c3fd to your computer and use it in GitHub Desktop.
Save agoiabel/2517f867b0b2521da903996cb160c3fd to your computer and use it in GitHub Desktop.
struct Dog {
let name: String
var breed: String
var age: Int
/** Get the dog details */
func myDogDetail() -> String {
return ("\(self.name) belongs to \(self.breed) and \(self.age)")
}
}
class Dog {
let name: String
var breed: String
var age: Int
init(name: String, breed: String, age: Int) {
self.name = name
self.breed = breed
self.age = age
}
/** Get the dog details */
func myDogDetail() -> String {
return ("\(self.name) belongs to \(self.breed) and \(self.age)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment