반응형
func showAlert() {
let alert = UIAlertController(title: "오류", message: "앱을 종료하시겠습니까?", preferredStyle: .alert)
let cancleAction = UIAlertAction(title: "아니오", style: .cancel, handler: nil)
let alertAction = UIAlertAction(title: "네", style: .default) { (action) in
print("\n---------- [ 장비를 정지합니다. ] ----------\n")
exit(0) // 앱 강제 종료
}
alert.addAction(alertAction)
alert.addAction(cancleAction)
self.present(alert, animated: true)
}
반응형
'iOS > iOS' 카테고리의 다른 글
| [iOS] MQTT를 이용한 채팅서비스 만들기 - MQTT mosquitto 서버 설치 (0) | 2020.04.22 |
|---|---|
| [iOS] MQTT를 이용한 채팅서비스 만들기 - MQTT (0) | 2020.04.22 |
| [iOS] MQTT를 이용한 채팅서비스 만들기 - 준비 (0) | 2020.04.18 |
| 개인적으로 자주 쓰는 확장시킨 함수 (0) | 2020.03.27 |
| FacebookLogin 바뀐 것 (0) | 2020.03.09 |