Swift Challenge 3: Tip Calculator

Day 3 was a bit trickier, took a longer time than I expected but I covered these areas:

  • Model
  • Sliders
  • Computation
  • Converting Floats to Ints, Floats to string etc
  • String formations
  • Some error handling, for example the code would break if I entered an empty value and I set in Xcode so it would open the numeric keyboard when entering values.
  • Less commenting on my code, please comment here if you felt you need clarification :)

Important notice: Why is only integers and no decimals? In Sweden, you cannot pay in less than 1 kr so I saw no reason to have it.

The tip calculator

I’m taking on more challenging things everyday now, I will still not focus too much on design. It would take too much time if I would be able to create a new challenge everyday + designing it.

New challenge tomorrow, take care!

Show your support

Clapping shows how much you appreciated Joacim Nidén’s story.