Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created October 26, 2014 04:17
Show Gist options
  • Save angelsystem/f28e57530328d43c8327 to your computer and use it in GitHub Desktop.
Save angelsystem/f28e57530328d43c8327 to your computer and use it in GitHub Desktop.
Alert swift IOs
//
// 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