-label & button & UIAlertController & autolayout
//
// ViewController.swift
// HelloWorld
//
// Created by Park on 8/30/15.
// Copyright © 2015 Park. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var label1: UILabel!
@IBAction func showMessage(sender: AnyObject) {
label1.text = “Welcome to Swift”
let alertController = UIAlertController(title: “Welcome to my first iOS App”, message: “Hello World”, preferredStyle: UIAlertControllerStyle.Alert)
alertController.addAction(UIAlertAction(title: “OK”, style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alertController, animated: true, completion: nil)
}
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.
}
}