Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override func viewDidLoad() {
- super .viewDidLoad()
- }
- func showOkay (){
- let title = NSLocalizedString("a title", comment: "")
- let message = NSLocalizedString("msg", comment: "")
- let cansal = NSLocalizedString("cancel", comment: "")
- let ok = NSLocalizedString("ok", comment: "")
- let alertController = UIAlertController (title: title, message: message, preferredStyle: .alert)
- let cancelAlertAction = UIAlertAction (title : cansal , style : .cancel) {
- _ in print("cancel") \ i don't understand this line . its just a print or somthing else . why i cant use print here.
- }
- let okAction = UIAlertAction(title: ok , style : .default){
- _ in print("ok") \ i don't understand this line. its just a print or somthing else. why i cant use print here.
- }
- alertController.addAction(cancelAlertAction)
- alertController.addAction(okAction)
- present(alertController ,animated: true , completion: nil)
- }
- @IBAction func btnAction(_ sender: Any) {
- showOkay()
- }
Add Comment
Please, Sign In to add comment