title: Adding index at uitableview is not working in Swift 2.0
body: <p>I am loading contacts in UITableView and I want to add index at the right end for user to navigate through contacts. </p>
  
  <p>I am using the code: </p>
  
  <pre><code>var indexOfNames = [String]()
  let indexNames = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
  indexOfNames = indexNames.componentsSeparatedByString(" ")
  
  func sectionIndexTitlesForTableView(tableView: UITableView) -&gt; [String]? {
      return indexOfNames
  }
  
  func tableView(tableView: UITableView, sectionForSectionIndexTitle title: String, atIndex index: Int) -&gt; Int {
      let temp = indexOfNames as NSArray
      return temp.indexOfObject(title)
  }
  </code></pre>
  
  <p>But it is not working. When I tap on the index, the table view comes to the top row. i.e. <code>A</code>. I have set the delegates for tableview. Maybe there is some issues with Swift 2.0?</p>