티스토리 뷰

728x90

let alertTitleStr = "alert title"

let alertMessageStr = "alert message"

let actionStr = "action"

let cancelStr = "cancel"

let destructiveStr = "destructive"

 

let alert = UIAlertController(title: alertTitleStr, message: alertMessageStr, preferredStyle: .alert)

alert.addAction(UIAlertAction(title: actionStr, style: .default, handler: { UIAlertAction in

    print(actionStr)

}))

alert.addAction(UIAlertAction(title: cancelStr, style: .cancel, handler: { UIAlertAction in

    print(cancelStr)

}))

alert.addAction(UIAlertAction(title: destructiveStr, style: .destructive, handler: { UIAlertAction in

    print(destructiveStr)

}))

self.present(alert, animated: true)

728x90

'ios' 카테고리의 다른 글

switch  (0) 2022.05.26
enum : Character & String  (0) 2022.05.24
short cut  (0) 2022.05.24
closure - sort  (0) 2022.05.24
enum - case, case, case  (0) 2022.05.24
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함