// MARK: - Table view delegate // 单元格点击 override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { // print("您点击了\(indexPath.section)组,\(indexPath.row)行") let menu = UIAlertController(title: "提示", message: "您点击了\(indexPath.section)组,\(indexPath.row)行", preferredStyle: .alert) let option = UIAlertAction(title: "确认", style: .default, handler: nil) let option2 = UIAlertAction(title: "取消", style: .cancel, handler: nil) let option3 = UIAlertAction(title: "删除", style: .destructive, handler: nil) menu.addAction(option) menu.addAction(option2) menu.addAction(option3) menu.addAction(option) self.present(menu, animated: true, completion: nil) }
iOS笔记【UIAlertCotroller】 2017-09-06
原文:http://www.cnblogs.com/lizhipengvvip/p/7499668.html