Created
October 26, 2014 04:17
-
-
Save angelsystem/f28e57530328d43c8327 to your computer and use it in GitHub Desktop.
Alert swift IOs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// spiner-alert | |
// | |
// Created by Angelito Rojas on 25/10/14. | |
// Copyright (c) 2014 Angelito Rojas. All rights reserved. | |
// | |
import UIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
@IBAction func alert(sender: AnyObject) { | |
var alert = UIAlertController(title: "Hi there", message: "are you sure?", preferredStyle: UIAlertControllerStyle.Alert) | |
alert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: { action in | |
self.dismissViewControllerAnimated(true, completion: nil) | |
})) | |
self.presentViewController(alert, animated: true, completion: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment