/EarthquakesSample

Take the next steps in app development, and build an app to download, decode, and present data from a network data source. Use SwiftUI to build a simple interface to display dynamic data from a concurrent network client.

Primary LanguageSwift

EarthquakesSample

About this module These tutorials are designed for experienced developers who are familiar with Swift and SwiftUI. If you’ve completed the SwiftUI module and the UIKit module, you’re well prepared for this one. You may encounter some new features of SwiftUI, but you’ll spend most of your time building the underlying types that you need to load and manage data over the network.

Technology Overview The Foundation framework contains types to request and transfer data over HTTP. The Swift standard library contains support for decoding JSON data. You’ll transfer and decode the data using the concurrency features that Swift 5.5 introduced, and you’ll present the results with SwiftUI.

Create apps more quickly and with fewer errors using these key Swift features:

Customized decoding — Swift has built-in data decoding features that automate common decoding tasks and simplify complex ones.

Concurrent design — Language features like asynchronous functions, tasks, and actors make writing asynchronous and concurrent code almost as straightforward as writing synchronous code.

Safety from data races — Concurrent programming often comes with hard-to-debug errors, such as data races. Swift actors help you easily avoid this type of error.

Testable components — Network operations can be difficult to test. Generics are a way to decouple dependencies and improve your app’s testability.

Integration with SwiftUI — SwiftUI has the tools to keep your user interface in sync with an asynchronous data source.