Last active
December 20, 2018 11:14
-
-
Save agoiabel/e0c992bce2055c09eedb2937400aa640 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
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