The Star Wars Reader is a demo app/learning exercise that uses SwiftUI and Combine to browse a dataset of Star Wars information.
-
The networking components of the app use Combine to make requests for network resources.
- The main data fetcher utilizes the new
dataTaskPublisher
method that returns a publisher to deliver results of the network request rather than a callback closure (i.e.,dataTask(with:completionHandler:)
). - Additional methods are chained to this publisher to return publishers that deliver data structures parsed from this data.
- The main data fetcher utilizes the new
-
The interface is built entirely using SwiftUI, which lends itself nicely to MVVM patterns and mock data sources for testing while you are developing.
-
Navigation between views is handled by a
FlowCoordinator
, which has the responsibility for initializing new views to be used asNavigationLink
destinations. These initializers are injected into the view models via closures. -
The data for the app is read from SWAPI, the Star Wars API, using GraphQL via the SWAPI GraphQL Wrapper.
Clone the repo, open the project in Xcode, and run! May the Force be with you.