標籤:row sheet ids add rri print pre 單元 override
1.種類 中部提示框-alert 底部提示框-actionSheet2.功能表項目參數 title:標題 取消 style:樣式 .cencel handle:nil 誤操作 把功能表項目添加到UIAlertController:使用addAction方法 顯示菜單:使用self.present
// 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