TipSplit was one of my earlier projects with SwiftUI taking the code from just functionality to UI elements, view displayers and Auto Layout for multiple devices. I learnt differnt UI elements, and pulled in arrays, selection tools and restricting keyboard input to accept only int values.
App allowed me to create different sections, along with user guidance for data input; and fixed values (such as tip percentage).
TipSplit allows for calculating grand total of a bill including varied tip percentages, and calculate a per-person amount due.
I also played with the leading and trailing parts of the Navigation Bar to add grand total (trailing), and total per person (leading). Opted to exclude leading as this resulted in confusion and clutter.
Code: .navigationBarItems(leading: Text(“$(totalPerPerson, specifier: “%.2f”)”))
Nested within NavigationView of the Struct class