O'Reilly logo

Protocol-Oriented Programming with Swift by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calculator application

In this case study we will create a very simple calculator application. This application will give the user the ability to add, subtract, multiply, and divide whole or decimal numbers.

We will not go through how to set up the application or the UI design in this section. We will leave that up to you, the reader. This will let you design the UI as you want to and also allow you to build the application as an iOS or an OS X application. You could even build it as a Linux-based application since Swift is now open source.

You can download my iOS calculator application with the code bundle for this book. My design looks like the following screenshot:

Now let's look at the requirements.

Requirements

Here are the requirements for our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required