본문 바로가기

iOS/Swift

[ios - swift] alert

let alert = UIAlertController(title: "Warning", message: NSLocalizedString("not valid qr code", comment: ""), preferredStyle: UIAlertController.Style.alert)
    alert.addAction(UIAlertAction(title: NSLocalizedString("confirm", comment: ""), style: .default){
        (action) in
        //button alick event
})

present(alert, animated: true, completion: nil)