What error message do you get ?
Where ?
During compilation or execution ?
But you declare xoutput as a String (a text)
var xoutput = self.xaxis.text
and later use it in a computation.
distance = velocityi * 0.1 + (1/2) * xoutput * pow(0.1, 2)
You should try;:
var xoutput = Double(self.xaxis.text) ?? 0.0
In addition, you repeat
while x == 1 { }
As x never change, this will repeat infinetely. Is it what you want ?
Topic:
Developer Tools & Services
SubTopic:
Xcode