Snippet

In order to create a rotating banner marquee on screen we can use a label along with help of core animation to achieve the effect as follows. The location of the text and duration can be controlled by changing the frame co-ordintes. In the below example the text moves from right to left side of the screen.

  1.    UILabel* lblTime = [[UILabel alloc] initWithFrame:CGRectMake(900, 0, 235, 19)];
  2.    [lblTime setBackgroundColor:[UIColor clearColor]];
  3.    [self.view addSubview:lblTime];
  4.        
  5.                
  6.    [UIView beginAnimations:nil context:NULL];
  7.    [UIView setAnimationDuration:20];
  8.    [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.view cache:YES];
  9.    [lblTime setText:@"Now Available in Appstore!"];
  10.    [lblTime setTextAlignment:UITextAlignmentLeft];
  11.    lblTime.frame = CGRectMake(-300, 0, 235, 19);
  12.    [UIView commitAnimations];

<!>