Skip to content

Instantly share code, notes, and snippets.

@biloshkurskyi-ss
Created July 29, 2019 09:49
Show Gist options
  • Save biloshkurskyi-ss/52218bf2a6e69d50268d4297e66e4765 to your computer and use it in GitHub Desktop.
Save biloshkurskyi-ss/52218bf2a6e69d50268d4297e66e4765 to your computer and use it in GitHub Desktop.
OOP at Swift - Abstraction
import Foundation
class Vehicle {
var model: String
var make: Int
init(model: String, make: Int) {
self.model = model
self.make = make
}
func start() { print("Vehicle - Start") }
func stop() { print("Vehicle - Stop") }
}
let сuriosity = Vehicle(model: "Rover", make: 2011)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment