Created
July 29, 2019 09:49
-
-
Save biloshkurskyi-ss/52218bf2a6e69d50268d4297e66e4765 to your computer and use it in GitHub Desktop.
OOP at Swift - Abstraction
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
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