To help you out, UIViewController is a class, which you are subclassing. It is not a protocol, so it doesn't have any necessary methods for you to implement. You can however override the methods you inherit, which is what you see in when you first create the file, ex.
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
This overrides the method you inherited from UIViewController. If you aren't doing anything other than calling super.viewDidLoad()
you can remove the entire function from your code.
Now UITableViewDataSource and UITableViewDelegate or both protocols, so they may or may not have required methods to implement.
What you describe when you alt-click, is the same as if you right clicked on UITableViewDataSource and selected jump to definition. This is what you get when you command click on an actual Mac. What the tutorial is saying is that the required methods will be at the top, which isn't always the case if you look at the documentation (as the methods are organized more by purpose there). In the case of UITableViewDataSource, you should see something like:
protocol UITableViewDataSource : NSObjectProtocol {
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
// Row display. Implementers should *always* try to reuse cells by setting each cell's reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier:
// Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls)
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
optional func numberOfSectionsInTableView(tableView: UITableView) -> Int // Default is 1 if not implemented
optional func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? // fixed font style. use custom view (UILabel) if you want something different
optional func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String?
You will notice that the first two methods func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
and func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
do not have optional in front of them. This means that these are the required methods for this protocol. The optional ones below that are optional.
In the case of UITableViewDelegate you'll see that there are no non-optional methods, and therefore it does not require you to implement any.