Good afternoon, dear people.
I’ve seen a pretty cool design which I’m attaching below and I wanted to somehow implement it in our MyLocations app. I want to show categories in GridView style like below and when a user taps on a category, it would perform a segue to the another view controller showing locations related to that particular category s/he has chosen.
So here are the tasks:
- Make a new UICollectionView with category names on the cells.
- When user taps on the cell, it should segue to the LocationsView but showing only those of the category chosen.
The problem is I’ve no idea how to do this
Thanks for help. I’ll be researching further.
Start small. I suggest you create a new project first and experiment with making a collection view. Doing this in a new project is handy because you don’t have to worry about connecting it to the existing code yet. All you need to do first is learn how to make a collection view. There are plenty of tutorials on this site that show how to do that.
We have a few tutorials handy - start with Getting Started.
Your segue is a very standard thing. You get the indexPath of the cell tapped when the UICollectionViewDelegate sends didSelectItemAt - using that you can learn which cell was tapped, and then select only the category you like. That might be as simple as changing a Core Data delegate, but it will depend on how you have designed the app.
Thank you Will start right away and keep you posted on my progress