Skip to content

Instantly share code, notes, and snippets.

@joninsky
Created April 22, 2020 20:46
Show Gist options
  • Save joninsky/794c4eff3f94ee3cca79b80997e874d7 to your computer and use it in GitHub Desktop.
Save joninsky/794c4eff3f94ee3cca79b80997e874d7 to your computer and use it in GitHub Desktop.
Networking coordinator setup
class ApolloNetworkingController: ObservableObject {
@Published var businesses: [BusinessFragment] = []
@Published var businessesQueryRunning: Bool = false
@Published var businessesQueryError: Error?
@Published var searchText: String = "Food"
lazy var locationController: LocationController = LocationController()
//Other details not shown here like init, subscriptions to these variables, and the actual networking call
//which will result in these variables getting manipulated and then displayed in the SwiftUI
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment