From the course: Shared Economy for iOS Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Subscribing to updates

Subscribing to updates - iOS Tutorial

From the course: Shared Economy for iOS Development

Start my 1-month free trial

Subscribing to updates

- [Instructor] Now that the driver is updating the server with their location, we want the customer to see those updates. So we'll do that in the Mower details view controller. This is where we're going to subscribe to the updates. If we go look at the API dot swift file, we can do a search for our subscription. And we can see that there's On Create Service Request subscription, there's an update on Delete and same for users. We want the On Update Service Request subscription. So back in our Mower Details View Controller, we're going to create a new property for our class up at the top. So after our App User Property, we're going to create a new property called Watcher. We need a Watcher and we need to stay in scope so that the subscription will continue to live. And this is going to be of type AWS App Sync Subscription Watcher. And you have to pass in a generic of what type of subscription you want. And we want the On Update Service Request subscription. This will be an optional, and…

Contents