확인, 취소
let alert = UIAlertController(title: "비밀번호 바꾸기", message: "비밀번호를 바꾸시겠습니까?", preferredStyle: .alert)
let success = UIAlertAction(title: "확인", style: .default) { action in
print("확인버튼이 눌렸습니다.")
}
let cancel = UIAlertAction(title: "취소", style: .cancel) { action in
print("취소버튼이 눌렸습니다.")
}
alert.addAction(success)
alert.addAction(cancel)
// 실제 띄우기
self.present(alert, animated: true, completion: nil)
'iOS > UIKit' 카테고리의 다른 글
[UIKit] 코드로만 로그인 화면 만들기, MVC 적용 (0) | 2023.11.12 |
---|---|
[UIKit] TextField Delegate (0) | 2023.11.12 |
[UIKit] autolayout, code base UI (0) | 2023.11.11 |