sorry for my english, I have some trouble to animate a view,
I have a button, i want to move the pushView when button press.
this is my code:
- (IBAction)buttonDidClicked:(id)sender {
[UIView animateWithDuration:0.3
delay:0.0
options:UIViewAnimationOptionCurveEaseIn
animations:^{
CGRect frame = self.greenView.frame;
frame.origin.x -= 100;
self.someView.frame = frame;
} completion:^(BOOL finished) {
}];
}
It would be work very well here.
but when I change some UI`s property like label.text,
like that:
- (IBAction)buttonDidClicked:(id)sender {
[UIView animateWithDuration:0.3
delay:0.0
options:UIViewAnimationOptionCurveEaseIn
animations:^{
CGRect frame = self.greenView.frame;
frame.origin.x -= 100;
self.greenView.frame = frame;
} completion:^(BOOL finished) {
int i = [self.label.text intValue];
i++;
self.label.text = [NSString stringWithFormat:@"%d", i];
}];
}
the pushView will move back to the first place.
I have a video to explain that: http://youtu.be/eJ9CaTkSaPU
the error just happened in iOS 8.1,
it would be work normal in iOS 7.1 or before.
How to solve the issue?
thanks a lot