From the course: Learning AWS Amplify (2020)

Unlock the full course today

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

Save data to the server

Save data to the server - Amazon Web Services (AWS) Tutorial

From the course: Learning AWS Amplify (2020)

Start my 1-month free trial

Save data to the server

- [Instructor] Well, this is it. Get excited. This is where we store data on the server. One thing we're going to need is the code that was generated for us during Amplify's processing, so I'm going to right click on Picogram and say Add Files and select this API.swift file. Now this file has a lot of the classes and structures that we use to delete Picograms and create Picograms, so we have a create Picogram input. We'll also need a create Picogram mutation, and same for update and delete. So let's use the create and start creating. So I'm going to create a new function down here, and I'm going to name it store on line. So I'll say func storeOnline. And it's going to take a parameter called item that's a Picogram item, and also a completion handler. And this'll be called whenever we're done. So I'm going to mark it as escaping, so that we can call it from another callback, and it's going to take a Bool, and return a…

Contents