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![0as 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

+ Recent posts