Hi, I'm new to Swift and app development so please do not hate me.
Here's my code:
@IBAction func equalsTap(_ sender: Any) {
if(validInput()){
let checkedWorkingForPercent = workings.replacingOccurrences(of: "%", with: "*0.01")
let expression = NSExpression(format: checkedWorkingForPercent)
let result = expression.expressionValue(with: nil, context: nil) as! Double
let resultString = formatResult(result: result)
calculatorResults.text = resultString
}
else {
}
}
And I get an error Thread 1: signal SIGABRT at the line let result = expression.expression...
Could you help me, please?