woman coding on computer

What is SwiftUI

SwiftUI is an open-source framework developed by Apple for building user interfaces across Apple platforms, including iOS, macOS, watchOS, and tvOS. It was introduced in 2019 alongside the release of Swift 5.1 and Xcode 11. SwiftUI provides a declarative and modern way to create user interfaces, making it easier and more efficient for developers to design and build applications. Key...Read More
photo of imac near macbook

Display currency in SwiftUI

To display Currency properly formatted in SwiftUI you have to do the following Define the value of Currency as a double @State private var unitPrice = 0.0 For a TextField, write this: TextField("Unit Price: ", value: $unitPrice , format: .currency(code: Locale.current.currency?.identifier ?? "USD")) For a Text, write this: Text(unitPrice, format: .currency(code: Locale.current.currency?.identifier ?? "USD")) Here's how the entire code looks...Read More