Horje
create alert in swift Code Example
create alert in swift
class ViewController: UIViewController {

    @IBAction func showAlertButtonTapped(_ sender: UIButton) {

        // create the alert
        let alert = UIAlertController(title: "My Title", message: "This is my message.", preferredStyle: .alert)

        // add an action (button)
        alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil))

        // show the alert
        self.present(alert, animated: true, completion: nil)
    }
}




1

Related
use timer swift Code Example use timer swift Code Example
swift for loop Code Example swift for loop Code Example
convert string to int swift Code Example convert string to int swift Code Example
give background color swiftui Code Example give background color swiftui Code Example
swift generate random number Code Example swift generate random number Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13