This project is based on swift3.0 syntax.
1 //2 //Viewcontroller.swift3 //Addition Calculator4 //5 //Created by Geyang on 2017/7/25.6 //Copyright 2017 Geyang. All rights reserved.7 //8 9 Import UIKitTen One classViewcontroller:uiviewcontroller { A -@IBOutlet weak var textone:uitextfield! -@IBOutlet weak var texttwo:uitextfield! the@IBOutlet weak var resultlabel:uilabel! - - - @IBAction func Calculate () { +var num1 = Int (self.textone.text!) -var num2 = Int (self.texttwo.text!) + Avar resultnum = num1! + num2! at -var resultstr ="\ (resultnum)" - -Self.resultLabel.text =ResultStr; - - } in - Overridefunc viewdidload () { to super.viewdidload () + //additional setup after loading the view, typically from a nib. - } the * Overridefunc didreceivememorywarning () { $ super.didreceivememorywarning ()Panax Notoginseng //Dispose of any resources the can be recreated. - } the + A}
iOS Development Calculator