text: Here we will learn iOS ui alerts in swift with example and how to use ios alerts in swift to convey important information with example using Xcode.
  In iOS alerts are used to alert or inform the user with important information regarding the action which he is doing to proceed further in app. Generally, iOS uses alerts to inform the user while phone battery running low, so they can connect power adapter to charge the phone before their work gets interrupted.
  In iOS applications alert view will appear on the top of app content so user must close manually before they start using the app.
  The iOS alert will contain alert title, optional message and one or more buttons like as shown above and we don't have any chance to customize the style of alert.
  We can use Alerts in our iOS applications by adding UIAlertView class reference.
  Now we will see how to use iOS UI Alerts in our iOS Alerts: “Alert button from canvas interface and drop into ViewController.swift file like as shown below.
  After completion of button mapping write the following code in button Action in ViewController.swift file.
  )
  }
  Once we finished writing all the required functionality in ViewController.swift file our code will be like as shown below
  // ViewController.swift
  // Alert in iOS
  // Created by Tutlane on 09/08/2016.
  import UIKit
  class ViewController: UIViewController {
  @IBOutlet weak var alert: UIButton!
  )
  }
  override func viewDidLoad() {
  super.viewDidLoad()
  // Do any additional setup after loading the view, typically from a nib.
  } Alerts application. If you observe by default it is showing button once we click on button it will show alert message like as shown below.
  This is how we can use iOS UI Alerts in swift app to alert or show the important information to the user regarding the action he is performing in app.