swift - Input text into a text field using a button? -


so i'm trying make vat converter wich gets vat percentage of slider , applies value taken uitextfield, outputs text field. button push action looks this:

@ibaction func calculate(sender: anyobject){  var curentval = int(slider.value) // vat % slider  var sum = sum.text.toint() //  var vat = sum! * curentval/100 // im trying output in text field called vat 

you can use one

@iboutlet weak var txtvat:uitextfield!  @ibaction func calculate(sender: anyobject){    var curentval = int(slider.value) // vat % slider    var sum = sum.text.toint()    var finalval = sum! * curentval/100   txtvat.text = uint8(finalval) } 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -