I'm having a problem, I have a UIButton
in a UIViewController
class and I want to enable that button after an animation that happens in a UIView
class that is in another file.
class MainViewController: UIViewController {
@IBOutlet weak var nextButton: UIButton!
@IBAction func nextButtonPressed(sender: UIButton) {
nextButton.enable = false
}
}
When I try to call the nextButton
from the viewController
class after the animation is done I get this error:
EXC_BAD_INSTRUCTION(code = EXC_I386_INVOP, subcode = 0x0)
I get the error on the line where I set the nextButton enable to true.
class CustomView: UIView {
var vc = MainViewController()
func animationEnded() {
vc.nextButton = true
}
}
I don't have a clue what I'm missing and I would appreciate some help. Thanks