Episode #463

Data Fetching and Caching with Pigeon

26 minutes
Published on October 2, 2020

This video is only available to subscribers. Get access to this video and 574 others.

Pigeon is an interesting and powerful library for SwiftUI and UIKit for fetching and caching data. In this episode we will explore the library and how we can use it to build a simple Star Wars Universe explorer app using the Star Wars Dev API.

Episode Links

  • Star Wars Dev API - This is a useful free/zero-authentication API for quick networking examples
  • Pigeon - Pigeon is a SwiftUI and UIKit library that relies on Combine to deal with asynchronous data. It is heavily inspired by React Query.

From the README:

With Pigeon you can:

  • Fetch server side APIs.
  • Cache server responses using interchangeable and configurable cache providers.
  • Share server data among different, unconnected components in your app.
  • Mutate server side resources.
  • Invalidate cache and refetch data.
  • Manage paginated data sources
  • Pigeon is agnostic on what you use for fetching data.
  • All of that working against a very simple interface that uses the very convenient ObservableObject Combine protocol.

This episode uses Swift 5.3, Xcode 12.0, Pigeon 0.1.16.