Skip to content

Instantly share code, notes, and snippets.

@abhimuralidharan
Last active February 20, 2017 04:39
Show Gist options
  • Select an option

  • Save abhimuralidharan/26c0c5f038a763cb32872e9b0c1b6858 to your computer and use it in GitHub Desktop.

Select an option

Save abhimuralidharan/26c0c5f038a763cb32872e9b0c1b6858 to your computer and use it in GitHub Desktop.
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