I have a view with an image shows some text in it. I need to perform animation which reveals the character by character in the end the complete text has to be displayed.
I have a logo view in my interface, over that I have animate view. for animate view the Leading, trailing, top and bottom constraints are set based on the superView (logo view).
I have tried following code but the duration which I have specified is not working properly.
- (void) animateLogo {
[UIView animateWithDuration:10.0 animations:^{
NSLog(@"animation started");
if (self.animateViewLeadingConstraint.constant < 94) { //94 is the total width of the logo view
self.animateViewLeadingConstraint.constant = self.animateViewLeadingConstraint.constant + 1;
} else {
self.animateViewLeadingConstraint.constant = 0;
}
} completion:^(BOOL finished) {
NSLog(@"animation ended");
[self.animateView layoutIfNeeded];
[self animateLogo];
}];
}
I have attached the log for time duration
2016-08-01 17:55:27.317 sample[20361:481531] animation started
2016-08-01 17:55:27.318 sample[20361:481531] animation ended
2016-08-01 17:55:27.318 sample[20361:481531] animation started
2016-08-01 17:55:27.318 sample[20361:481531] animation ended
2016-08-01 17:55:27.318 sample[20361:481531] animation started
2016-08-01 17:55:27.319 sample[20361:481531] animation ended
2016-08-01 17:55:27.319 sample[20361:481531] animation started
2016-08-01 17:55:27.319 sample[20361:481531] animation ended
I am not sure what mistake I have made in above code or am I misunderstood the UIView Animation concept
Any help or hint would greatly appreciated.