alertViewcontroller example iOS swift

Solution:

AlertViewcontroller is used for show alertView to the user to get simple inputs like okay and cancel.

            let alertController = UIAlertController(title: "AVCam", message: message, preferredStyle: .alert)
            alertController.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "Alert OK button"), style: .cancel, handler: nil))
            alertController.addAction(UIAlertAction(title: NSLocalizedString("Settings", comment: "Alert button to open Settings"), style: .default, handler: { action in
             

                }
            }))

let cancelActionButton = UIAlertAction(title: "Cancel", style: .cancel) { action -> Void in

                }
               
alertController.addAction(cancelActionButton)
            self.present(alertController, animated: true, completion: nil)

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift