Add Curved text in Objective C
In this tutorial, i will tell you about how to add curved texts in your application to make it look better.
For adding Curved Texts in your application do the following steps :
Step 1. Go to curved text sample in the github and download the file.
Step 2. From the downloaded sample, drag CoreTextArcView.h , CoreTextArcView.m to your project and check copy to destination folder.
Step 3. Import CoreTextArcView.h in your ViewController.m.
Step 4. Turn off arc of the CoreTextArcView.m by go to Build Phases >> Compile sources and turn off arc by typing fno-objc-arc
Turn off arc |
Step 5. Add the following code in your viewDidLoad to add curved text :
Your final output will be :
Result |
Here is your curved label .
Thanks :)
Nice sample for understand , I like it. I have one question , To use this sample app can we draw text without arch.
ReplyDeleteIf I am using arh is 0 then text are shrinking Please suggest , What i can get horizontal text.
Hi Tikam ,
ReplyDeleteThanks for reading .
Is it necessary to give arc size ?
Yes it is necessary to give arc size and radius because only then you ll be able to give curve to your text .
How we can draw horizontal text . After that I will give arch size from slider change.
ReplyDeletePlease help me.?
Can you be more specific ?
ReplyDeleteI didn`t get what you want ?
Actually I want draw a text it would be horizontal text . then when user change the slider it would be curve as per the slider value.
ReplyDeleteThanks for Quick response . Did you get my points?
ReplyDeleteOK
ReplyDeleteYou have to change arc size as well as radius when you change your slider.
arc size and slider values should be in proportion .
I am doing same. but still text are very shrink and characters are overlapping.
ReplyDeletePlease reply?
ReplyDeleteHi Tikam , That can't be possible using this library . You have to find some other library for that .
ReplyDelete