Home:ALL Converter>Not able to use UITableViewDelegate

Not able to use UITableViewDelegate

Ask Time:2015-01-02T08:55:53         Author:user3369038

Json Formatter

I am new to iOS so please bear with me if this is a basic question. I am following these tutorials and in lecture 43, the guy deletes the existing view controller and adds a new view controller. Then he inserts a table view (from the storyboard), command clicks on the table view and assigns the dataSource and delegate to the view controller.

Then in the ViewController.swift file, UITableViewDelegate is added so that it looks like

import UIKit

    class ViewController: UIViewController, UITableViewDelegate{

        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
        }

        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }


    }

Then he command clicks on UITableViewDelegate to copy these two functions:

    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!

Now! These are the problems that I am facing:

1) When I write UITableViewDelegate, there is no auto complete (which suggests something is wrong)

2) When I command click on UITableViewDelegate, it says Symbol not found (so I cannot get the above functions)

Would massively appreciate any help please.

Many thanks!

Author:user3369038,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/27736211/not-able-to-use-uitableviewdelegate
yy