i am trying to increase the temperature with animation on button click
it is working when i tap the button first time but when i tap the button again nothing happens.
I am using a image view (red color) for showing the temperature
here is my code that i am using behind action
]2
UIView.animateWithDuration(3.0, animations: {
self.progress.transform = CGAffineTransformMakeTranslation((self.progress.frame.origin.x -self.progress.frame.origin.x ), -30)
})
it should increase each time i click the + button but its not happening can anyone explain what is the issue ?
To move your image you should do a concatenation of your transformations
UIView.animateWithDuration(3.0, animations: {
let transform = CGAffineTransformMakeTranslation(0, -30)
self.progress.transform = CGAffineTransformConcat(self.progress.transform, transform)
})