A simple RPN Calculator app
The app we are going to implement is a simplified version of an RPN Calculator. The UI will have an upper section, which will show the four upper values in the stack in reversed order, and a lower part with the numbers 0 to 9, the four basic operations, and an Enter key, which will put the value in the stack.
When we create the app using the wizard in Xcode, we must remember to check the two boxes to add Unit and UI tests.
The view in the storyboard mimics a simple calculator with the basic operations and four entries for the stack; as we mentioned earlier, the stack is upside down, with the topmost element at the bottom. The button with the e represents Enter, which will push the elements in the stack up and insert ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access