Please note, this blog entry is from a previous course. You might want to check out the current one.
Modify the UILabel you added last week to show your CalculatorBrain’s description instead. It should put an = on the end of it (and be positioned strategically so that the display looks like it’s the result of that =). This = was Extra Credit last week, but it is required this week.
When setting the display value use the calculator-brain description for the history text (adding an equal sign).
var displayValue: Double? {
...
set {
...
history.text = brain.description + " ="
}
}
And when starting a new number use it without the equal sign:
@IBAction func appendDigit(sender: UIButton) {
...
history.text = brain.description != "?" ? brain.description : ""
}
}
The complete code for the task #8 is available on GitHub.