我要创建一个按钮,每次触摸img sen0向右移动一段距离后,将img sen1转换为img sen2,这样我将转到sen10
请专业人士教书
我尝试使用if并在单击按钮更改img时声明了一个值,但是每次更改它时,非标准动作都不会更改
@IBAction func RightButton(_ sender:Any){
UIView.animate(withDuration: 1, delay: 0, options: UIView.AnimationOptions.curveEaseOut, animations: {
self.Consen.image = UIImage(named: "sen1")
}, completion: { finish in
UIView.animate(withDuration: 1, delay: 0,options: UIView.AnimationOptions.curveEaseOut,animations: {
self.Consen.frame.origin.x = self.Duongchosen.frame.width / 11
self.RightOutlet.isEnabled = true
},completion: nil)
})
}