初学IOS开发HelloWorld-swift版本

看图


下面附上代码import UIKit

class ViewController: UIViewController {

@IBOutlet weak var display: UITextField!

@IBAction func xianshi(_ sender: UIButton) {
    display.text="HelloWorld"
}

@IBAction func qingkong(_ sender: UIButton) {
    display.text=" "
}

}
最后看模拟器效果图

原文地址:https://www.cnblogs.com/xubaby0912/p/12398409.html