SwiftUI - Integrating UIKit

SwiftUI doesn’t provide neither a UICollectionView nor a UIActivityIndicator equivalence so we need to integrate the components directly from UIKit. Apple’s built-in solution to address this issue is the UIViewRepresentable...

SwiftUI - Connecting the models

The MVVM architecture is a perfect fit for SwiftUI as one can make a view model conform the ObservableObject and mark its underlying properties as @Published so that views always...

SwiftUI - Networking

A view will often use an observable object to reflect the latest data fetched from a web-service. Apple has introduced the Combine framework, a way to handle asynchronous events by...

SwiftUI - Updating the UI

Updating the user interface in SwiftUI is rather simple with the newly introduced @State attribute which acts as a wrapper around a value. struct ContentView: View { @State private var...

SwiftUI - Communicating with the UI

Apple provides three means of communication with different scopes. @State @ObservableObject @EnvironmentObject The @State and @Environment attributes belong to the SwiftUI framework. The @ObservableObject attribute is part of the Combine...