반응형
공감 및 댓글은 포스팅 하는데 아주아주 큰 힘이 됩니다!! 포스팅 내용이 찾아주신 분들께 도움이 되길 바라며 더 깔끔하고 좋은 포스팅을 만들어 나가겠습니다^^
|
이번 포스팅에서는
제목대로 ios 에서 Ok, Cancel 다이얼로그 만드는 방법입니다.
전에 포스팅했던 다이얼로그만들기에서 심화된 단계입니다.
확인,취소 다이얼로그는 우리가 앱에서 자주 볼 수 있죠.
좀 귀찮은 앱들은 종료할 때 종료할 건지 묻는 다이얼로그가 나오니까요 ㅎㅎ
만드는 방법은 간단합니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | let alert : UIAlertController = UIAlertController(title: commuteAlertTitle, message: commuteAlertMsg, preferredStyle: .alert) let okAction : UIAlertAction = UIAlertAction(title: "확인", style: .default) { (action :UIAlertAction!) in print("tapped Ok") } let noAction : UIAlertAction = UIAlertAction(title: "취소", style: .cancel) { (action :UIAlertAction!) in print("tapped cancel") } alert.addAction(okAction) alert.addAction(noAction) self.present(alert, animated: true, completion: nil) // 호출 | cs |
어렵지 않죠?
in
// 요기에 필요한 기능들을 넣어주시면 됩니다.
}
이상입니다.
감사합니다.
반응형
'IOS(iPhone)' 카테고리의 다른 글
ios snackBar 사용방법입니다. -> material.io/components (0) | 2017.11.21 |
---|---|
ios swift3 split 함수 사용방법 -> component(separatedBy: "문자") (0) | 2017.11.20 |
ios swift3 UIImageView 에 Click Event 클릭이벤트 추가하기! (0) | 2017.11.17 |
ios x-code 로 개발하던 중 발생한 xcode command failed due to signal segmentation fault 11 에러 해결 방법 (0) | 2017.11.15 |
ios swift3 Yes No Alert Dailog 생생방법입니다. (0) | 2017.08.31 |