1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | uiNickCell.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(nickTouch))) @objc func nickTouch() { let inputAlert = UIAlertController(title: "알림".localized(), message: "닉네임을입력해주세요".localized(), preferredStyle: .alert) inputAlert.addAction(UIAlertAction(title: "확인".localized(), style: .default, handler: { (action: UIAlertAction!) in let textField = inputAlert.textFields![0] as UITextField if textField.text != "" { self.uiNick.text = textField.text } })) inputAlert.addAction(UIAlertAction(title: "취소".localized(), style: .cancel, handler: { (action: UIAlertAction!) in print("Handle Cancel Logic here") })) inputAlert.addTextField { (textField) in textField.placeholder = "닉네임을입력해주세요".localized() } present(inputAlert, animated: true, completion: nil) } | cs |
'Swfit' 카테고리의 다른 글
| swift 컨트롤러 선언후 화면 띄우기 (0) | 2020.04.01 |
|---|---|
| ViewController 간에 데이터 전송 (0) | 2020.04.01 |
| 스위프트 라이브러리 모음 (0) | 2020.03.31 |
| 스위프트 푸시 설정 (0) | 2020.03.31 |
| 코코아팟 문세발생시 제거하고 pod 다시설치 (1) | 2020.03.31 |