第一个APP

//

//  ViewController.swift

//  app1

//

//  Created by apple on 15/12/18.

//  Copyright © 2015 apple. All rights reserved.

//

 

import UIKit

 

class ViewController: UIViewController {

    @IBOutlet weak var l1: UILabel!

    @IBOutlet weak var b1: UIButton!

    override func viewDidLoad() {

        super.viewDidLoad()

        l1.text="abc"

        b1.setTitle("ni", forState: .Normal)

        b1.addTarget(self, action: "clickMe:", forControlEvents:.TouchUpInside)

        

    }

    func clickMe(sender:UIButton)

    {

        print("abc")

        l1.text="11111"

    }

 

    override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()

        // Dispose of any resources that can be recreated.

    }

 

 

}

 

原文地址:https://www.cnblogs.com/egai/p/5058290.html