Skip to content

Instantly share code, notes, and snippets.

@alperenarc
Last active May 11, 2021 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alperenarc/fe04647113acd5a0f019995e60ba0140 to your computer and use it in GitHub Desktop.
Save alperenarc/fe04647113acd5a0f019995e60ba0140 to your computer and use it in GitHub Desktop.
Person
class Person {
var name: String
init(name: String) {
self.name = name
}
func printMyName() { fatalError("Error here 😈") }
func printMyAge(age: Int) { }
}
class MainController: Person {
override func printMyAge(age: Int) {
print(age)
}
}
let mainControllerInstance = MainController(name: "Alperen")
mainControllerInstance.printMyAge(age: 21)
print(mainControllerInstance.name)
mainControllerInstance.printMyName()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment