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
Post a Comment