|
Good morning all, I am trying to create a selectable list much like the iTunes Store app when you tap Genres in the nav bar at the top a sheet comes up that shows a list of Genres to select from and a checkmark to the right on the selected row. I am just at a loss on how to get the checkmark on the row.
If anyone has any ideas on how to add a checkmark that would be great. Thanks Taz |
|
Hi, have you tried to add property to your topic Something like that:
|
|
I assume you mean a
A Mock
and now for
|
|
@ygeras Thanks so much for the reply. Sometimes the simplest solution is the hardest to figure out, LOL. At least for me, I tend to overthink the problem. So I did this using UserDefaults. I wanted a simple way to persist the choice if still on the tab. I ended up with this:
Anyway, thanks for your reply, Taz |
|
@NigelGee Hey, my friend, I appreciate the reply. I'd thought about doing it in a Menu which would give me the checkmark automatically, but my list of topics is over a 100. So I didn't feel the menu was the right fit for a list that long. Plus, by putting this in a sheet I can give the user the ability to filter the topics with .searchable modifier. Again my friend, thanks for great solution. Taz |
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.