Override question?

I am trying to create an app similar to the Guided Project: List in "App Development with Swift" with one change. I would like an opening view controller that segues to the tableview. I have that set up but when I get to the point in the lesson where it overrides the function viewDidLoad I get an "override can only be specified on class members" error. That override is already in the viewcontroller.swift file. Should I delete or change that override in the view controller.swift file?


I hope this is not too vague. If you need more information let me know. I am totally new to programming in Swift.


Thanks in advance for any help.

Replies

are you sure you do not have a closing bracket } before the override which makes viewDidLoad be out of the class definition ?

Thanks for the reply Claude. I checked that and it seems to be okay. It might be easier if I attached my code. I'm new to apple, could you direct me to the instructions on how to do it.

To attach the code of the controller, just copy and paste (use paste and adapt style menu).

Then select all the code and click on <> on the hedare of the message body. That will format the text properly.

I have the same problem since I'm using Swift4. My code seems ok.