Requires a pro subscription Pro

AWS AppSync for iOS

Learn how to consume GraphQL APIs in your SwiftUI iOS apps in a simple and type-safe way using AWS AppSync framework. By Jessy Catterwaul.

Login to leave a rating/review
Download materials
Save for later
Share

Who is this for?

This course is intended for developers who are interested in learning how to integrate Amazon’s BaaS technology. A good understanding of Swift, SwiftUI, and Combine will be helpful for following along with integration into the app you’ll be working on in this course.

Covered concepts

  • AWS AppSync
  • AWS Amplify
  • GraphQL

Part 1: AppSync Setup with Amplify

1
Toggle description

Get an overview of Amazon’s BaaS offering, AppSync, along with their Amplify framework. They work together to add a back end component to your iOS app.

Toggle description

AWS AppSync acts as a bridge between GraphQL and other AWS services such as data storage, caching and real-time updates.

Toggle description

npm (Node Package Manager) is a command line interface (CLI) for managing Node.js packages. You’ll need npm installed for installing AWS Amplify.

Toggle description

npm makes it simple to install Amplify. All you need to do is bring an AWS account, which is simple and easy to set up.

Toggle description

You can employ the Swift Package Manager for installation of all the Amplify libraries you will need.

Toggle description

Using a GraphQL schema, you can tell Amplify what models to generate. Afterwards, you’ll be able to interact with them using Swift.

Conclusion 0:22
Toggle description

You’ve created a user, set up an app, and added it to the AWS dashboard. You also created a GraphQL API and published it to AWS. You’re all set up to use AppSync!

Part 2: Integrate AppSync into an App

8
Toggle description

With the libraries installed, and models generated, it’s time to make RazeList, a to-do app, come to life!

Toggle description

Before “configuring” Amplify, you’ll need to import libraries, and create instances of appropriate plugins.

Toggle description

Create a Row view that will correspond with a Todo instance. Then, add some published Todos to the view model.

Toggle description

Create two sections: one for to-dos that you still need doing, and the other, for ones you’ve completed.

Toggle description

The final step of getting the UI working, before we get back to focusing on AppSync specifically, is to integrate the “add to do” screen.

Toggle description

Amplify has save and query methods which makes interacting with the cloud a breeze. You can either use them with Combine, or deal with them synchronously.

Toggle description

So far, the app is great for showing you what you need to do — but not so good at letting you complete those tasks. AppSync to the rescue, again!

Toggle description

The final thing you need to add is a way to delete rows. Swipe-to-delete already exists in the UI, so you just need to wire it up.

Conclusion 0:35
Toggle description

You now know the basics of integrating and using AppSync with Amplify in your iOS apps — but there’s a lot more to learn!