iOS/iOS
앱 강제 종료
ywangnon
2020. 3. 24. 11:43
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)
}