【发布时间】:2016-06-25 17:09:03
【问题描述】:
我无法解决我的代码中的“if let”问题。根据错误说我必须使用可选类型?
@IBAction func operate(sender: UIButton) {
if userIsInTheMiddleOfTypingANumber{
enter()
}
if let operation = sender.currentTitle {
if let result = calcModel.performOperation(operation){
displayValue = result
}else {
displayValue = 0
}
}
}
【问题讨论】: