ボタン押下時に他のボタンを無効化したい
stopButtonを押した時に、nextButtonとbackButtomを無効化したいのですが、どのようにすれば良いですか?
IBAction func nextButton(_ sender: Any) {
if imageIndex == 2 {
imageIndex = 0
}else {
imageIndex = imageIndex + 1
}
imageView.image = images[imageIndex]
}
@IBAction func backButtom(_ sender: Any) {
if self.imageIndex == 0 {
imageIndex = 2
}else {
imageIndex = imageIndex - 1
}
imageView.image = images[imageIndex]
}
@IBAction func stopButton(_ sender: Any) {
timer = Timer.scheduledTimer(timeInterval: 2, target: self,
selector: #selector(self.movePhoto(_:)), userInfo: nil, repeats: true)
}