dannydjg16 / YoJoe

YoJoe iOS Application
1 stars 0 forks source link

Delegate/Datasource location #5

Closed dannydjg16 closed 4 years ago

dannydjg16 commented 5 years ago

https://github.com/dannydjg16/MoJoe/blob/3e781c1cb71e13ed71fd40ce5be83266eda3677a/MoJoe/ShopReviewCell.swift#L62

For background info, shop tags are essentially a way to quickly talk about the features of whatever shop you just visited. In another file, you select however many you want then I am trying to present the selected tags inside of a collection view on the actual feed of all the shop reviews from all the people. Shop review cell is the type of tableview cell that is on the shop review feed.

The thing is on untappd if you check in a beer then leave a flavor profile, there is a collection view(I’m pretty sure) that shows all the flavors you just added to the beer. To me with what I know, it seems like you set up the tableview cell that is the check in of the beer in the view controllers file that it is on. So this means that you’d retrieve from the database on that view controller file and set the cells on that file(in the delegate/datasource methods cellForRow and numberOfRows). If there is a collection view, to me it seems like the delegate and datasource methods should be put in tableview cell file and not the whole view controller file. The problem now is that you retrieve all the info from the check in the view controller file, but you set the collection view (with the same delegate/datasource methods but just for cv rather than tableview) in the tableview cell file. I think I remember you setting the delegate and datasource to another file than what the tableview is on one time, but that was after literally the first tableview I ever did so I was so confused. Is the answer something like that or is it done another way?

dannydjg16 commented 5 years ago

the shop tags collection view is a collection view on the shop review tableview cell.

dannydjg16 commented 5 years ago
shopreviewfeed shopreviewscreen
dannydjg16 commented 5 years ago

the second pic is the review view controller, you pick however many shoptags you want then I want those to be printed on to the collection view. The first pic is the feed with all the shop reviews. I already have the shoptags on the shop review tableviewcell(about the shop:) but i think it would look better in a collection view. All the info (starbs, cappucino, about the order:) is retrieved in the view controller's file that the tableview is inside of so it is easy to also set the tableview cell there. A collection view on a table view (to the extent of my knowledge) should be set up inside the tableview cell file, but i am not retrieving the info of the shop review in that file so I dont know how to fill the collection view with the shop tags that correspond to each review.