我想添加一个过滤选项,如在iPhone联系人->最近,它有两个过滤器,说全部和错过。我想说的都是今天,过去和即将到来的。
所有可用的例子都是在其中使用搜索栏,但我不需要搜索栏。
发布于 2015-09-07 10:09:41
简单,只需使用分段控件与您的3个值。

然后将段连接到值更改的操作。就像这样
@IBAction func filterTable(sender: UISegmentedControl) {
if sender.selectedSegmentIndex == 0 {
//User selected today! Filter the table for it
}
else if sender.selectedSegmentIndex == 1 {
//User selected past! Filter the table for it
}
else {
//User selected upcomming! Filter the table for it
}
}https://stackoverflow.com/questions/32435818
复制相似问题