Limit and define maximum number of user selections allowed in a check mark selection list for iPhone
I currently have a Selection List TableView that allows a user to make multiple selections from a list.
How can I limit the number of selections a user can make in a check mark selection list, defining a maximum allowable number of selections?
In the iOS TableView User Guide, I only see very limited info describing an Exclusive Selection list for allowing only one single selection and an Inclusive Selection List fo开发者_Go百科r allowing multiple selections, but I haven't been able to find any info on defining a specific maximum number of selections. I'd like to limit the user to be able to make up to a maximum of 3 selections, while still allowing them to make only one or two selections if they wish.
Can anyone provide any info on how to do this? Thanks!
I think that you can easily enough just roll your own max checker in didSelectRowAtIndexPath
Keep an instance variable count of how many you currently have selected, and check it against your max number in didSelectRowAtIndex before you checkmark that row.
精彩评论