It’s been several month now since I have published my video course on Udemy about “How to create user Sign in, Sign up, Password reset, Email verification, Push notifications and other vital for our mobile app features with Swift and Parse“. Since then I have received so many messages from students who took the course as well as from my blog subscribers asking me for an example on how to query data that belongs to a user and is stored in other custom classes in Parse and how to build “one-to-many” relationship in Parse and how to query user data and display it in a table view with Swift.
After clearing a little bit my to-do list by getting things done and after publishing my very first little book “How to Build an App with UITabBarController and Sliding Left Side & Right Side Views (One Particular Example)” on Amazon I can finally do an example I have promised to many of you.
So here we go. In this blog post I am going to share with you how to query user data from other Custom classes in Parse using Swift. And although this little example app we will build in this tutorial is going to be very simple, it will cover many interesting topics like:
- Create a new Custom class in Parse
- Learn how to create a Pointer from one Custom class to another
- Learn how to associate records stored in a Music class/table to a particular User
- Implement “One to one” or “One to many” relationship in Parse. For example, one user will own many Music items in a custom class
- Implement UITableView, then query a list of users from Parse User class and display this list of users in a UITableView
- Implement UITableViewDelegate and UITableViewDatasource functions
- Learn how to build UITableViewController and load user data into it
- Pass data forward from one view controller to another
- Use a Pointer to access data stored in other custom class. For example we will access User object from a record in a Music class.
- and etc..
In this first video I am going to demonstrate a sample mobile app we are going to build in this tutorial.
2) Create New Custom Class and a Pointer
In this second video we are going to create a new custom class in Parse called Music and learn how to create a Pointer from one custom class to another. We will build one to many relationship in our parse data structure so that one User can have many music items and we can query data stored in a Music class for a particular user.
3) Display List of Users in a Table View
In this video we are going to:
- Create a UITableView
- Implement functions from UITableViewDelegate and UITableViewDatasource
- Query list of registered with our mobile app users
- Display list of users in a table view
4) Load User Data Stored in a Different Parse Custom Class
In this video we are going to learn how to:
- Pass information from one view controller to another
- Build a new UITableView controller
- Load user data stored in a different Parse custom class
- Display user data in a table view
5) Load User Details from a User Class Using Pointer
In this final video we will see how to use Parse Pointer to access information associated with current record but stored in a different custom class in Parse. For example we will access User object and user details associated with a current record in a Music table.
I hope this video tutorial is helpful to you!
You can download source code of this example application from this Github url: https://github.com/simplyi/QueryDataFromOtherCustomClassInParse-example.git