开发者

String to Appear Bit by Bit Logic

开发者 https://www.devze.com 2023-03-26 08:09 出处:网络
What I want to achieve is to have a name in the middle of the screen appear one letter at a time, at a timed interval.

What I want to achieve is to have a name in the middle of the screen appear one letter at a time, at a timed interval.

I have the following for my "fade in" effect:

// Fade In effect
-(void)fadeIn:(UIView*)viewToFadeIn withDuration:(NSTimeInterval)duration 
  andWait:(NSTimeInterval)wait
{

[viewToFadeIn setAlpha:0.0];
[UIView animateWithDuration:duration delay:wait options:UIViewAnimationOptionTransitionCurlUp animations:^{[viewToFadeIn setAlpha:1.0];} completion:nil];

}

Is there any animation for 开发者_如何学Pythonthis??

Any help is appreciated, thank you!!!


Just use a NSTimer to cal a method to reset the field string each time using one more character of the string, for example;

NSUInteger  theLength = [outputString length]+1;
if( theLength == [originalString length]
{
    [timer invalidate];
    timer = nil;
    outputString = originalString;
}
else
    outputString = [originalString substringToIndex:theLength];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号