【发布时间】:2018-08-16 16:54:10
【问题描述】:
我正在尝试使用 UISwitch 在单独的 ViewController 上隐藏和显示 UIButton。但是,我不确定如何在单独的 ViewController 上进行设置。
我已经尝试使用 segue 来更改按钮,但它不起作用,因为必须触发 segue,并且我不想在打开或关闭 UISwitch 后更改页面。
目前我为 UISwitch 和 UIButton 设置了@IBAction:
@IBAction func `switch`(_ sender: UISwitch) {
}
@IBAction func hideButton(_ sender: UIButton {
}
【问题讨论】:
-
请添加您当前的代码
-
我添加了我当前的代码。
标签: swift xcode button switch-statement