More than half of the apps I built during my career had networking code. Usually, we build apps for web services. Today we will talk about building the type-safe networking layer using Swift language features like enums, phantom types, and extensions.
Fetching JSON data and rendering it into a list is now changing with SwiftUI. The pattern you must follow now is to create state variables through a Bindable object and observe it through your view widgets. To load image data, we do the same thing through different state objects.
Part two: Async data and remote images
Generating dynamic lists and details screens from an API that returns JSON is a fairly common need in modern applications. In this video, we’ll show how to use URLSession to fetch JSON, decode it using JSONDecoder, and then use BindableObject and State properties to create a SwiftUI list from the results.
We'll learn about performing HTTP requests in SwiftUI and posting simple JSON data with SwiftUI using HTTP request.
This week I want to talk about building a networking layer in Swift using Functional programming. Functional programming is a way of making programs using pure functions and function composition. Let’s see how we can use it to build a flexible and composable network layer.
When Apple announced the new framework at WWDC2019, I decided to jump into the new opportunity with a challenge to build the first messaging app on SwiftUI.
...it’s time to touch the crucial aspect of every app, and it is data. All the apps have data to present or mutate. Data plays a vital role in apps using SwiftUI. Every view in SwiftUI is just a function of some state, where the state is our data.