如何在所有开关处于 ON 状态后取消隐藏按钮?

How to unhide the button after all switches in ON condition?

我有 2 个 UI 开关和一个按钮,在 viewDidLoad 中,我将按钮设置为隐藏和禁用,如果这 2 个开关处于打开状态,我只希望我的按钮不被隐藏ON 状态,否则,我希望我的按钮再次隐藏。 UI Switch delegate 有什么方法可以使用吗?我如何在 Swift 中做到这一点?

这是我使用的代码

import UIKit

class AskingAuthorizationVC: UIViewController {

    @IBOutlet weak var locationSwitch: DesignableSwitch!
    @IBOutlet weak var notificationSwitch: DesignableSwitch!
    @IBOutlet weak var nextButton: DesignableButton!


    override func viewDidLoad() {
        super.viewDidLoad()

        // initial state
        nextButton.isHidden = true
        nextButton.isEnabled = false
        notificationSwitch.isOn = false
        locationSwitch.isOn = false


    }

    @IBAction func signUpButtonDidPressed(_ sender: Any) {
        performSegue(withIdentifier: "toAuthenticationVC", sender: nil)
    }


}

将 UISwitch-s 挂钩为 IBActions 和 IBOutlets

@IBAction func oweSwitch(_ sender: UISwitch) {

    self.mybutton.isHidden = !(switch1.isOn && switch2.isOn)

}