LocationViewController.swift does not have Override func when created?

I am a begginer using Swift.
In the example I am following the instructions tell me to create a folder called Location and as sub folders create 2 other folders called Model and View. It then instructs me to right click on Location, new file (Cocoa Touch Class) and name the swift file LocationViewController and create the file.
According to the book, it should contain the following override function:

override func viewDidLoad() {

As this is automatically generated I can't see why this is missing?
Can anybody explain why this code is missing?

This question is really about Apple frameworks, not Swift. You'll probably get better responses over at the Apple developer forums, StackOverlfow, or another Apple-themed developer site.

It has to do with Xcode templates which are files that provide a template. When you ask Xcode to create a new file, you should get a palette of file types to start with. The code you asking for is in that file.

Swift does not autogenerate code for the private Apple frameworks at all, if that is what you asking.

The new file has to be a subclass of UIViewController. Then it will have viewDidLoad()

Terms of Service

Privacy Policy

Cookie Policy