Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adam-siton/AUIAnimatedText
A drop-in UILabel replacement that makes almost all properties animatable by using a CATextLayer instead of CALayer.
https://github.com/adam-siton/AUIAnimatedText
Last synced: 3 months ago
JSON representation
A drop-in UILabel replacement that makes almost all properties animatable by using a CATextLayer instead of CALayer.
- Host: GitHub
- URL: https://github.com/adam-siton/AUIAnimatedText
- Owner: adam-siton
- License: mit
- Created: 2011-09-05T18:30:39.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-05T11:18:20.000Z (about 12 years ago)
- Last Synced: 2024-09-17T14:42:16.262Z (4 months ago)
- Language: Objective-C
- Homepage: http://corecocoa.wordpress.com/2011/10/04/animatable-text-color-of-uilabel/
- Size: 248 KB
- Stars: 236
- Watchers: 7
- Forks: 45
- Open Issues: 1
-
Metadata Files:
- Readme: README.mdown
Awesome Lists containing this project
- awesome - AUIAnimatedText - A drop-in UILabel replacement that makes almost all properties animatable by using a CATextLayer instead of CALayer. (etc)
- awesome - AUIAnimatedText - A drop-in UILabel replacement that makes almost all properties animatable by using a CATextLayer instead of CALayer. (etc)
README
AUIAnimatableText
============
AUIAnimatableText is a drop-in UILabel replacement that uses CATextLayer instead of the regular CALayer, and thus making almost all the properties animatable.### Properties animatable in AUIAnimatableText and not in UILabel
1. textColor
2. text
3. font
3. fontSize### Adding AUIAnimatableText to your project
1. Add AUIAnimatableText.h+m and UIFont+CoreTextExtensions.h+m to your project
2. Link your project with CoreText.framework and QuartzCore.framework (In your project's settings, go to "Build Phases" and there to "Link Binary With Libraries")
3. Change the class of your labels from UILabel to AUIAnimatableText in code or in interface builder
4. That's it.After doing the above steps you can simply change the label's properties inside a UIView animation block and they will change animated.
To get the duration to work properly it looks like you need to use:
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithFloat:0.7f] forKey:kCATransactionAnimationDuration];
{...new layout code here...}
[CATransaction commit];(I'm not sure if CATransaction supports block-style animation, this is just what I've found out so far.