In Obj C I used to use some code for pick up data from label, pull it in float and doing any calcul needed.
float chiffre1 = [[label1 text] floatValue];
float chiffre2 = [[label2 text] floatValue];
float number1 = chiffre1 + chiffre2;
Now in Swift I try to do the same thing but always end up with error. the code work very well in play ground, but when I use it in my app, and try to use data from a UILabel, doesn't work anymore.
@IBOutlet weak var DegreeLat1: UILabel!
@IBoutlet etc...
let deglat1 = DegreeLat1.text
let number2 = MinutLat1.text?.toInt()
let minlat1 = number2! / 60
let etc....
let lat1 = (degrelat1 + minlat1 + seclat1) * pi /180 // error "could not find an overload for "*" that accepts the supplied argument
let long1 = (etc...) * pi / 180
I tried many thing check almost everywhere can't find what I do wrong.