Gri*_*ini 1 uitableview ios swift
我有一个设置页面,我不确定如何使注销工作.我被告知要使用CellForRowAtIndexPath来实现这一点,当我点击"注销"时,我可以使用PFUser.logout()将其设置为实际注销
我确定这是一个简单的答案,但我找不到任何远离我所寻找的东西,有人有快速的解决方案吗?非常感谢你提前.
您需要didSelectRowAtIndexPath
在UITableViewDelegate
协议中使用该方法,该方法告诉委托现在选择指定的行来处理UITableView
以这种方式选择的单元格:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
// call to the PFUser.logout() here to log out the user properly
print(indexPath.row)
}
Run Code Online (Sandbox Code Playgroud)
我希望这对你有帮助.