tmdvs / TDBadgedCell

TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps
www.tmdvs.me
MIT License
1.43k stars 182 forks source link

sizeWithFont: deprecated #58

Closed fulldecent closed 9 years ago

fulldecent commented 10 years ago

In this code

CGSize numberSize;
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
    numberSize = [self.badgeString sizeWithAttributes:@{ NSFontAttributeName:font }];
} else {
    numberSize = [self.badgeString sizeWithFont:font];
}

Even though iOS 7 is checked for and it uses the new API, the else case generates an undesirable compiler warning. Perhaps another approach may be prefered here.

fulldecent commented 9 years ago

Recommending #if here