This course is available as part of the raywenderlich.com Professional subscription. To learn more click here
Pro

AWS AppSync for iOS

Jul 13 2021 · Video Course (28 mins) · Intermediate

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

Version

  • Swift 5, iOS 14, Xcode 12

AppSync Setup with Amplify

Introduction

1:20 Free

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.

1

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

2

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

3

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.

4

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

5

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

6

Conclusion

0:22

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!

7

Integrate AppSync into an App

Introduction

0:18 Free

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

8

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

9

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

10

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

11

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.

12

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.

13

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!

14

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.

15

Conclusion

0:35

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

16

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

Contributors

Comments