I tried the below code on https://iswift.org/playground, but it says use of unresolved identifier NSExpression
. Please let me know if I am missing something.
var numericExpression = "4 + 3 - 2"
let expression = NSExpression(format: numericExpression)
var result = expression.expressionValueWithObject(nil, context:nil)
return result