我正在尝试使用Segmented控件和switch语句实现登录/注册操作:
@IBAction func signInRegisterAction(_ sender: UISegmentedControl) {
switch signInRegister.selectedSegmentIndex {
case 0:
signInButton.setTitle("Sign in", for: .normal)
case 1:
signInButton.setTitle("Register", for: .normal)
default: break
}
}
我想在这个按钮动作中意识到:
@IBAction func signInButtonAction(_ sender: UIButton) {
if signInRegisterAction.0 {
one action
}else{
second action}
}
请帮我在signInButtonAction中做逻辑!