title: Cannot assign value of type 'String' to type 'UILabel'
body: <p>I am trying to pass data from tableview to another page (view controller) but problem is i am getting an error from tableview. Below is the code and i have marked the error where i am getting.</p>
  <blockquote>
  <p>P1ViewController.Swift</p>
  </blockquote>
  <pre><code>class P1ViewController: ViewController,UITableViewDelegate,UITableViewDataSource {
      var name=[&quot;Table1&quot;,&quot;Table2&quot;]
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return name.count
      } 
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell=tableView.dequeueReusableCell(withIdentifier: &quot;cell&quot;)
          cell?.textLabel?.text=name[indexPath.row]
          return cell!
      } 
      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
          let detail=self.storyboard?.instantiateViewController(withIdentifier: &quot;DetailViewController&quot;) as! DetailViewController
          detail.lblName=name[indexPath.row] //This is the error i am getting &quot;Cannot assign value of type 'String' to type 'UILabel'&quot;
          self.navigationController?.pushViewController(detail, animated: true)
      }
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  }
  </code></pre>
  <blockquote>
  <p>DetailViewController.Swift</p>
  </blockquote>
  <pre><code>class DetailViewController: ViewController {
      @IBOutlet weak var lblName: UILabel!
      var name:String!
      override func viewDidLoad() {
          super.viewDidLoad()
          lblName.text=name
      }
  }
  </code></pre>