2

What's the best way to fade in individual letters of a UILabel over time? I'm looking to create something similar to the example below.

http://s11.postimg.org/5s16qmwn5/secret.gif

user1218464
  • 1,011
  • 2
  • 12
  • 22
  • probably each letter is in a isolated `UILabel` and it faded one-by-one; or the `CoreGraphics.framework` used with dynamic texting; or `QuartzCore.framework` used with dynamic masking... there are many ways to implement such simple text effect. what have you tried so far? – holex Apr 06 '14 at 23:33
  • I wasn't sure what to go with since I didn't want to over-complicate it if there was an easy method I wasn't thinking of. I'm not too familiar with CATextLayers and was thinking that using a mask might be the easiest method. – user1218464 Apr 07 '14 at 03:21
  • the custom visual effects are usually clever imaginations and ideas only, not overcomplicated ones. the experience level of the developer defines which is the most clever solution for making a specific effect. it s not htoo gelful, and probably I won't be popular with my opinion (no offence at all!) but it is true and generic rule: if you need to ask _ideas_ from someone else about making a task, that task is probably over your level of experience. there are many possible solution are here for achieveing such an visual effect, and no one can tell you which idea fits for you. :( – holex Apr 07 '14 at 08:16

2 Answers2

0

I wouldn't use UILabel to do this.

I would create a UIView with CATextLayers inside it, one text layer for each character. Then you can animate the text layers independently.

Check out apple's WWDC videos on core animation to learn how it works. It's very simple.

Abhi Beckert
  • 32,787
  • 12
  • 83
  • 110
0

You may want to use NSAttributedText to create your own UITextView or UILabel that does that, basically randomly assigning UIColors with decreasing Alpha to different letters,

It will take a while to find the correct speed and rate of change. Open source it then :)

Luca Davanzo
  • 21,000
  • 15
  • 120
  • 146
  • Thanks! I was able to get it to have each letter go from alpha 0 to 1, but I haven't figured out how to make it fade in using NSAttributedText. – user1218464 Apr 07 '14 at 05:21