Friday 28 December 2012

Label with multiple color and font.

I have made a subclass of UILabel to set multiple color for different word or specific font within character range in label.In screenshot there is one UILabel displaying multiple foreground color and font with different sizes.


You can use ATLable custom file to get such label.

ATLable.h File 

ATLable.m File



How to use it

1)Create an instance of ATLable.
2)Set its frame according to your requirement.
3)Add as subView to view in which you wanna show it.
3)Use its setColor property to set ForeColor for specific range of characters.
4)Similarly use setFont property to set font of text for specific range of characters in lable you want to set.



Note: don't forgot to import CoreText Framework