andreamazz / AMTagListView

UIScrollView subclass that allows to add a list of highly customizable tags.
MIT License
758 stars 110 forks source link

Connect it to Parse.com #23

Closed lorencogonzaga closed 9 years ago

lorencogonzaga commented 9 years ago

Hi @andreamazz

I tried without success to link this project to Parse backend. In one view I would like to add the tags and save them to Parse with a save button and in another view, load them from Parse.

Any suggestion ?

andreamazz commented 9 years ago

The question is a little broad. I'm not familiar with Parse since I use custom backends, but I'm guessing that you send and get data in a RESTful way, via JSON. To load a set of tags you can simply parse your json data and feed the resulting array of strings to the tag view like this:

NSArray *tags = json[@"tags"];
[self.tagListView addTags:tags];

To send the data just get a list of tags with this:

NSMutableArray *stringTags = @[@[] mutableCopy];
NSArray *tags = [self.tagListView tags];
for (AMTagView *tag in tags) {
  [stringTags addObject:tag.tagText];
}

and you can then serialise the stringTags array in JSON.

Cheers