【发布时间】:2016-06-28 11:27:14
【问题描述】:
在我的应用程序中,我的 ParentViewController 中有一个分段控件和一个容器。容器中有一个名为 ChildTableViewController 的 TableViewController。我需要根据分段控件更改表中的数据。
问题:我有一个段控制操作设置,但我不确定如何引用子项来运行 reloadData() 或在更改段控制时以某种方式在 TableViewController 中运行触发器。
//MARK: IBActions
@IBAction func segmentedControlAction(sender: AnyObject) {
print(segmentedControl.selectedSegmentIndex)
}
此代码根据我单击的部分打印 0、1 或 2
【问题讨论】:
标签: xcode swift uitableview uisegmentedcontrol