【发布时间】:2015-08-06 09:53:36
【问题描述】:
我需要使用didSelectRowAtIndexPath 才能通过
搜索后我当前的单元格(这是我找到的唯一方法),
但是如何将此单元格名称传递给 SecondViewController?
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if(tableView == self.searchDisplayController!.searchResultsTableView){
if let cell: UITableViewCell = tableView.cellForRowAtIndexPath(indexPath){
if let cellTextLabel: UILabel = cell.textLabel{
let cellSelected = cellTextLabel.text!
}
}
}
在 SecondViewController 中,我需要使用 TextView 将当前文本呈现给选定的单元格。
【问题讨论】:
标签: ios xcode swift storyboard didselectrowatindexpath