I am wondering what is the best way to filter out various sections in a table view using a segmented control in a toolbar.
Say, for example, I have a tabular view with cells in three different sections - Friday, Saturday, and Sunday. I also have a toolbar on top of 4 segments: everything, Friday, Saturday and Sunday. When “All” is selected on the segmented element, all sections and cells in the table should be displayed. When Friday is selected in the segmented element, only cells in the Friday section should be displayed in the table. And so on and so forth.
Where in the code for the table view controller can I do this? I imagine this is a pretty simple thing to achieve, so are there any other examples of this that someone can point me to?
Thanks in advance!
source share