I’m quite happy that things are finally real now. The first challenge was to build upon what we learned in Day 18 with the WeSplit app and build our own conversion app. I chose to create a Simple Converter app that takes a value from the user along with a unit (kg, lbs, st) and then converts to the user’s choice of units (kg, lbs, st). Baby steps.
It all came together pretty quickly, though I learned an important lesson about testing in Xcode’s preview mode vs on the Simulator. I thought I was finished until the Simulator quickly showed me that I had forgotten to set the keyboard type (one of my all time UX pet peeves) and I also noticed that due to my simplified conversion math that if somebody tried to convert from pounds to pounds or stones to stones that they’d get an unexpected result.
A simple app like this leaves me wanting to tinker endlessly to make it better, but I don’t think that’s the point at this stage.
A couple of things that still confuse me at this point:
- When I need to set a keyboard type, Xcode’s hinting seems either non-existent or very slow on my machine, making it tough for me to know what my options are (e.g. .numberPad). With time, I’m sure I’ll learn many of these types of options, but for now it leaves me having to dig into Swift documentation to find out what some of the possible options are.
- I’m not entirely sure why this has parentheses on the end
.pickerStyle(SegmentedPickerStyle())
– I tend to forget about those pesky parentheses. I can choose SegmentedPickerStyle from Xcode’s suggestions, but it doesn’t automatically put the parentheses in, but instead barks at me with a somewhat confusing message. - Using text fields to capture numeric form data seems weird. I would have guessed that Swift/SwiftUI would be using something more specific for numbers.