2017. 2. 15. 13:29ㆍProgramming/Swift
let alertController = UIAlertController(title: "삭제 하시겠습니까?", message: "사용자: \(username)"+"\n"+"휴대폰: \(phone)"+"\n"+"네이트온: \(nateon)", preferredStyle: .alert)
let submit = UIAlertAction(title: "Submit", style: UIAlertActionStyle.default, handler: { (paramAction:UIAlertAction) in if let status = self.ArrayUserName[indexPath.row].authstatus, let auth = self.ArrayUserName[indexPath.row].authvalue { self.ProcessData(flag: "delete", authvalue: auth, authstatus: status) } self.ArrayUserName.remove(at: indexPath.row) tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.automatic) }) let cancel = UIAlertAction(title:"Cancel", style:UIAlertActionStyle.cancel, handler:nil)
alertController.addAction(submit) alertController.addAction(cancel) self.present(alertController, animated: true, completion: nil) |
let userMessage = "사용자: \(username)"+"\n"+"휴대폰: \(phone)"+"\n"+"네이트온: \(nateon)" let alertController = UIAlertController(title: "삭제 하시겠습니까?", message: userMessage, preferredStyle: .alert)
let submit = UIAlertAction(title: "Submit", style: UIAlertActionStyle.default, handler: { (paramAction:UIAlertAction) in if let status = self.ArrayUserName[indexPath.row].authstatus, let auth = self.ArrayUserName[indexPath.row].authvalue { self.ProcessData(flag: "delete", authvalue: auth, authstatus: status) }
self.ArrayUserName.remove(at: indexPath.row) tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.automatic) }) let cancel = UIAlertAction(title:"Cancel", style:UIAlertActionStyle.cancel, handler:nil)
let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = NSTextAlignment.left
let messageText = NSMutableAttributedString( string: userMessage, attributes: [ NSParagraphStyleAttributeName: paragraphStyle, NSFontAttributeName: UIFont.systemFont(ofSize: 15.0) ] ) alertController.setValue(messageText, forKey: "attributedMessage") alertController.addAction(submit) alertController.addAction(cancel) self.present(alertController, animated: true, completion: nil) |
'Programming > Swift' 카테고리의 다른 글
xcode에서 시뮬레이터가 보이지 않을 때 (0) | 2017.03.10 |
---|---|
swift3.0 설정으로 가기 (0) | 2017.02.17 |
3D 터치 구현 (0) | 2017.02.02 |
Notification - FCM 설정(3) : 소스 및 테스트 (0) | 2017.02.02 |
Notification - FCM 설정(2) : 선행 조건 (0) | 2017.02.02 |