Closed margusholland closed 8 years ago
Not sure which warning flags you have set on your project, but that's absolutely right, if you target iOS 6.0 or higher. That code is just a workaround for iOS versions lower than 6.0. I guess it should be solvable with a __IPHONE_OS_VERSION_MIN_REQUIRED
. Could you try this out, before I push an update?
#if defined(__IPHONE_6_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0)
CTTextAlignment alignment = NSTextAlignmentToCTTextAlignment(self.textAlignment);
#else
CTTextAlignment alignment = NSTextAlignmentToCTTextAlignment ? NSTextAlignmentToCTTextAlignment(self.textAlignment) : [self CTTextAlignmentFromNSTextAlignment:self.textAlignment];
#endif
Yep, works fine with that new code snippet and the warning goes away. I’m not using any other warning flags that come with the default settings of XCode.
Fixed in version 1.4.7
THLabel.m line 430:
CTTextAlignment alignment = NSTextAlignmentToCTTextAlignment ? NSTextAlignmentToCTTextAlignment(self.textAlignment) : [self CTTextAlignmentFromNSTextAlignment:self.textAlignment];
gives a warning "Code will never be executed".
Not really a problem, but I like to keep my code warning free, so might be worth fixing for people with similar needs.