Last active
February 20, 2017 04:39
-
-
Save abhimuralidharan/26c0c5f038a763cb32872e9b0c1b6858 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import UIKit | |
| class Vehicle { //definition.. | |
| var model: String! | |
| var tires = 4 | |
| func drive() { | |
| } | |
| func stop() { | |
| } | |
| } | |
| //subclassing.. | |
| var ford = Vehicle() //instance of class Vehicle. | |
| ford.model = "Mustang" // assiging value to a property of class vehicle. | |
| ford.drive() | |
| ford.break() | |
| var BMW = Vehicle() | |
| BMW.model = "7 series" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment