标签:one over import loading ios开发 resources swift iba tle
本项目基于swift3.0的语法。
1 // 2 // ViewController.swift 3 // 加法计算器 4 // 5 // Created by 葛杨杨 on 2017/7/25. 6 // Copyright ? 2017年 葛杨杨. All rights reserved. 7 // 8 9 import UIKit 10 11 class ViewController: UIViewController { 12 13 @IBOutlet weak var textOne: UITextField! 14 @IBOutlet weak var textTwo: UITextField! 15 @IBOutlet weak var resultLabel: UILabel! 16 17 18 @IBAction func calculate() { 19 var num1 = Int(self.textOne.text!) 20 var num2 = Int(self.textTwo.text!) 21 22 var resultNum = num1! + num2! 23 24 var resultStr = "\(resultNum)" 25 26 self.resultLabel.text = resultStr; 27 28 } 29 30 override func viewDidLoad() { 31 super.viewDidLoad() 32 // Do any additional setup after loading the view, typically from a nib. 33 } 34 35 override func didReceiveMemoryWarning() { 36 super.didReceiveMemoryWarning() 37 // Dispose of any resources that can be recreated. 38 } 39 40 41 }
标签:one over import loading ios开发 resources swift iba tle
原文地址:http://www.cnblogs.com/geyang/p/7239820.html