
Untitled
By: a guest on
Jul 20th, 2012 | syntax:
None | size: 0.77 KB | hits: 10 | expires: Never
Objective C moving Labels
-(void)doTheLabelThing {
// assume all the labels are in a container view that is 320 wide and 100 tall
self.labelContainer.frame = CGRectMake(0, -100, 320, 100);
[UIView animateWithDuration:0.5 animations:^{
// slide down
self.labelContainer.frame = CGRectMake(0, 360, 320, 100);
} completion:^(BOOL finished) {
// give user 3 seconds to read it
[UIView animateWithDuration:0.5 delay:3.0 options:0 animations:^{
// fade out
self.labelContainer.alpha = 0.0;
} completion:^(BOOL finished) {
// restore everything to original state
self.labelContainer.alpha = 1.0;
self.labelContainer.frame = CGRectMake(0, -100, 320, 100);
}];
}];
}