[Swift] What is "inheriting a class"?

To summarize briefly

** Take over the tricks from your parents. ** **

ViewController.swift


//Inherit UIViewController
class ViewController: UIViewController {

  //Use UIViewController methods
  override func viewDidLoad() {
    //super is the parent class
    super.viewDidLoad()
  }

First, it inherits the class of UIViewController. This allows you to use the tricks that UIViewController has. If you right-click on the UIViewController part and select ** Jump to Definition **, you'll see a list of tricks (yes, methods), but viewDidLoad is also in it.

In other words

You can inherit the trick of "swinging down the sword" from the parent class and add the action of "jumping" to it (override) to arrange the trick in your own way.

Recommended Posts

[Swift] What is "inheriting a class"?
What is a wrapper class?
What is a class in Java language (3 /?)
What is a class in Java language (1 /?)
What is a class in Java language (2 /?)
What is a constructor?
What is a stream
[Swift] What is dismiss?
What is a Servlet?
What is a boolean type?
What is a Ruby module?
What is a floating point?
What is a meaningful comment?
What is the BufferedReader class?
What is a jar file?
What is a Java collection?
What is a lambda expression?
[Java] What is class inheritance?
What is a fa⁉ enum?
[Java basics] What is Class?
What is the difference between a class and a struct? ?? ??
What is a snippet in programming?
What is a column Boolean type?
What is a reference type variable?
What is a lambda expression (Java)
What is a Ruby 2D array?
What is a terminal? -Absolute path & relative path-
What is a Spring Boot .original file?
What is Swift? Findings obtained in 3 weeks
[Rails] What is a dot (.) Or a colon (:)?
What is a request scope? Image commentary
What is Cubby
What is Docker?
What is null? ]
What is java
What is Keycloak
What is maven?
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is SLF4J?
What is Facade? ??
What is Java <>?
What is Gradle?
What is POJO
What is Java
What is RubyGem?
What is programming?
What is Docker
What is Byte?
What is Tomcat
Introduction to Recursive Functions: What is a Recursive Function?
What is Maven Assembly?
What is a safety reference operator (&.) Using Ruby ampersand?
What is `docker-compose up`?
What is vue cli
What is an interface?
What is Ruby's self?
What is hard coding?