SwiftUI: Split The Check App

This is a very short sample of an app that allows calculating how much every person should pay based on the check, the tip, and the number of people. Credits: This app is based on the course “100 Days of SwiftUI” by @twostraws. Code Sample import SwiftUI struct ContentView: View { @State private var checkAmount = 0.0 @State private var peopleQuantityIndex = 0 @State private var tipPercentage = 18 @FocusState private var shouldShowKeyboard: Bool static let currencyCode = Locale....

May 28, 2024 · 1 min

SwiftUI: Cheatsheet

SwiftUI Cheatsheet A friendly way to remember some SwiftUI snippets. SwiftUI Children Limits SwiftUI by default limits its children to 10. However, this doesn’t mean that we can’t have more than ten elements in the same view. We just need to add the Group {...} directive. In the following example, it can be noticed that we have seven children under the Form {...} directive and one of them is a Group {....

May 27, 2024 · 2 min