views:

45

answers:

1

Let's understand the my requirement / question.

  • I have to develop following things in my application.
  • Application starts with a view controller ( obviously )
  • Now, after loading the view controller
  • "Touch me" characters should enter on screen animating, animation direction should be random.

OK. Let me clarify again.

The aim of question is animation & Touch.

  • T (part of touch me) should enter from any corner of the screen & then o & ten u ...

After all character adjusts on the center screen, touch - tap event must be handled.

How to do this?

A: 

Watch out. I have implemented following in view did load.

lblTT.hidden=YES; lbloo.hidden=YES; lbluu.hidden=YES; lblcc.hidden=YES; lblhh.hidden=YES;
lblT.hidden=YES; lblo.hidden=YES; lblu.hidden=YES; lblc.hidden=YES; lblh.hidden=YES;
animation = [CABasicAnimation animationWithKeyPath:@"position"];
[animation setDelegate:self];
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(lblTT.frame.origin.x+17,lblTT.frame.origin.y+29)];
animation.fromValue = [NSValue valueWithCGPoint:CGPointMake(lblT.frame.origin.x,lblT.frame.origin.y)];
animation.autoreverses = NO;
animation.removedOnCompletion=YES;
animation.repeatCount = 0;
animation.duration = 1;
animation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear];
lblT.hidden=NO;
[lblT.layer addAnimation:animation forKey:@"T"];
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(hideT) userInfo:nil repeats:NO];
sugar