Last active
January 11, 2018 07:05
-
-
Save agoiabel/2517f867b0b2521da903996cb160c3fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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