tobihagemann / THLabel

UILabel subclass, which additionally allows shadow blur, inner shadow, stroke text and fill gradient.
https://tobiha.de
Other
665 stars 111 forks source link

TH Label not compatible under iOs 6 #7

Closed Crabman closed 10 years ago

Crabman commented 10 years ago

Hello,

I may be wrong but in the requirements sections of THLabel i read "iOS 4.0 or higher" and I assumed it could be used on devices running on iOS 4, 5,... but the use in the code of NSTextAlignmentToCTTextAlignment makes the code crash on devices under iOs 6.

Maybe it would be nice to just precise it on the description.

Anyway the label is really nice , thanks, too bad does not work on iOs 5 =)

Bye

tobihagemann commented 10 years ago

You are right, NSTextAlignmentToCTTextAlignment is just available on iOS 6. Nonetheless, could you try to just replace:

CTTextAlignment alignment = NSTextAlignmentToCTTextAlignment(self.textAlignment);

with:

CTTextAlignment alignment = self.textAlignment;

?

Crabman commented 10 years ago

Hey , thanks, that does the trick for my code ! However I'm only using the "Stroke" function so it may not work as expected on other uses on iOs 5.

Thanks a lot for the fast reply !

tobihagemann commented 10 years ago

No problem, thanks for reporting! :)