Last active
December 13, 2017 19:47
-
-
Save lucianoschillagi/b83130946e03aa14eae2b50d076e61fc 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 Arduino { | |
// properties without default value | |
var model: String | |
var microcontroller: String | |
var digitalIOPins: Int | |
} | |
let myArduino = Arduino(model: "Yún", microcontroller: "ATmega32U4", digitalIOPins: 20) // memberwise initializer | |
myArduino.model // prints "Yún" | |
let otherArduino = Arduino(model: "Uno", microcontroller: "ATmega328P", digitalIOPins: 14) // memberwise initializer | |
otherArduino.microcontroller // prints "ATmega328P" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment