rihekopo
rihekopo

Reputation: 3350

UILabel first letter lowercase

I'm trying to set the first letter of a UILabel to lowercase, but can't find answers that could help me. I would like to solve this problem without editing the original content.

Something like this is possible?

 myLabel.text.autocapitalizationType = UITextAutocapitalizationTypeNone;

Or i must make the NSString's (that holds the content) first letter to lowercase before i pass it to the label?

UPDATE:

As Nikolas said it's not possible with the UILabel, edit the string to solve the problem.

Upvotes: 0

Views: 471

Answers (1)

nburk
nburk

Reputation: 22731

I once was had the same issue, so I was very thoroughly scanning the docs of UILabel, but I didn't find an option that would allow achieving this on the level of the UILabel-API so I also ended up modifying the resulting NSString, so I guess that's not possible.

Putting the modifications into a cateogry for UILabel (UILabel+Capitalization.h) in the end worked quite well for me, so that every time the label was modified I could call something like: [label capitalize] was quite convenient. Hope that helps!

Upvotes: 1

Related Questions