A UISegmentedControl
is just a combination of multiple buttons. Here is what you have to do (considering you want to load some data in a table when a specific index on the control is selected)
- Create a
UISegmentedControl
in your class (programmatically or using xib). - Link it with a
selector
in the class (a function). - Reload your table in the function (
tableView reloadData
) - If you want different data for different segments, check the
selectedSegmentIndex
value and load different data in yourcellForRowAtIndexpath
.
For further reading - Class Reference
- UISegmentedControl Tutorial
Hope this helps.
1
solved How To show Data in Table with the help of SegmentViewControl in Xcode [closed]