【发布时间】:2016-07-26 22:00:34
【问题描述】:
我在 tableView 中填充了 BackendlessUsers 数组。如何在 didSelectRowAtIndexPath 函数中传递用户?
var deejays: [BackendlessUser] = []
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
print("You selected cell #\(indexPath.row)!")
self.tableView.deselectRowAtIndexPath(indexPath, animated: true)
**let user = deejays[indexPath.row]**
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("DJProfileAsUserVC") as! DJProfileAsUserVC
dispatch_async(dispatch_get_main_queue()) {
self.presentViewController(vc, animated: true, completion: nil)
}
}
非常感谢您的帮助。
【问题讨论】:
标签: ios swift backendless