Day 18 Complete

2022-07-14 1 min read

Today was review day for day 18 of the 100 Days of SwiftUI challenge.

Parts one and two of this part of the challenge were the development of the WeSplit app (in fact the app gets developed in part two, with part one being the preperation and learning part).

Part three (today) was a challenge to add functionality to the app without being shown the answers of how to do so. All the initial features were easy to add. The final harder challenge was to remove some duplication in the code by taking Locale and moving it into a constant. The hard part was figuring out how to move the Locale.current.currencyCode and .currency() formatter int the constant while getting the types correct.

It took me a while to figure this out, combine apples crappy documentation with a complicated combination of types and protocols and I was definitely confused. Eventually I got it but it took some trial and error to work out.