Load data from AWS DynamoDB table into UITableView on iOS

One of the screens of my iOS app written in Swift is the UITableView.
In this UITableView, I want to load data from an AWS DynamoDB table called Books .

This is currently the prototype of the cell that I have on my storyboard:

enter image description here

In the table I have 3 attributes: "Name", "Price" and "ISBN".
I want to scan the "Books" table and filter the results, so the "ISBN" attribute of the results will contain the number "9".

After I filtered the results, I want to apply them to the UITableView, so the value โ€œNameโ€ will place the label with the text โ€œNameโ€, and the value โ€œPriceโ€ will go to the label with the text โ€œPriceโ€. I want the "ISBN" value to go into some array so that I can recognize the "ISBN" of this book, according to the row index in the UITableView. Until you pay attention to the picture, I already know what to do with it.

I also did the same on Android, using Java, creating a data class (with get and set methods), viewing the table in the action code and then applying the data to TextViews using an adapter.

I am new to iOS and Swift, and I donโ€™t know how to do this, so I would be very happy if you would explain it to me step by step.

Could you help me figure it out?

+7
ios uitableview amazon-web-services amazon-dynamodb
source share
1 answer

I cannot give you the exact answer you want, but I will point you to a very good example that I saw on the Internet. Checkout DynamoDB iOS SDK sample application from AWS.

All you need is a mapperper object that will display the loaded data from DynamoDB into your application model class. The Checkout function is called refreshList () in DDBMainTableViewController.swift, which loads the data and displays it in the desired model.

Note. Remember to complete the configuration steps on the AWS page. The application will only be executed after you have completed the configuration steps suggested on GitHub.

+3
source share

All Articles