We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

scottybe • 11 years ago

I needed a blinking label in a UITableViewCell that was part of Navigation Controller. Adding an animation to the label as described above worked, but I had problems when the user swiped left (completely or canceled the swipe) because of the iOS calls to viewWillDisappear, etc. I ended up setting a timer that changed the alpha property of the label based a sine function that had a min of 0, max of 1, and period of 2.0 (seconds). theCell.theLabel.alpha = sinf(M_PI * seconds - M_PI_2) / 2.0 + .5. Note that 'seconds' was a float value based on the system clock. If I set the timer to run at least 20 times per second, it looked very smooth.

David DelMonte • 11 years ago

Thanks for writing this. It was extremely helpful..