i made UIsearch bar to search in my tableview and everything is ok, but the problem when i want to pass data from filtered array to another controller ,after i made the search, here my prepare
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "ahmed" {
if let indexPath = self.tableView.indexPathForSelectedRow() {
print(indexPath.row)
var object = Persons[indexPath.row]
(segue.destinationViewController as DetailViewController).name = object.name
}
}
}
this code work for non searched data which code should i write to pass searched data