Search code examples
iosswiftparse-platformacl

Parse Different user score for different objects


I'm currently learning Swift by building an iOS app that integrates with Parse to serve backend data. The app allows users to add Paintings to their own individual lists. It also allows users to set a score for each painting. I currently have set up user objects and painting objects in parse.

I am wondering how I could allow paintings to have different scores for different users. I am guessing that I should set a score property for the painting object, but can't really figure out how to let each user have a different score for each painting. (I am not sure if this has something to do with object ACLs, and if so I do not quite understand how I would implement the solution that I am looking for).


Solution

  • If by score you mean rating, like 5 start ratings, this is what i'd do:

    add a class to parse, named score.

    add the columns: | paintingID | userID | score |

    when a user scores a painting, add the row to the class using the info.

    when a user is looking at a painting, get the row from the score class that has the current user and current viewing painting. then get the score and show it.

    Hope this helps