Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Last active December 20, 2018 11:14
Show Gist options
  • Save agoiabel/e0c992bce2055c09eedb2937400aa640 to your computer and use it in GitHub Desktop.
Save agoiabel/e0c992bce2055c09eedb2937400aa640 to your computer and use it in GitHub Desktop.
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
}
}
//accessing the struct
var myDog = Dog(name: "Molly", breed: "Chichuacha", age: 1)
myDog.name //will return Molly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment