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

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift