Cocoanetics / DTFoundation

Standard toolset classes and categories
BSD 2-Clause "Simplified" License
805 stars 237 forks source link

Deprecated method in DTActivityTitleView #60

Closed odrobnik closed 10 years ago

odrobnik commented 10 years ago

Fix the deprecated sizeWithFont: usage in DTActivityTitleView

BenGlobism commented 10 years ago

I'm somewhat of a novice but this is what I did to work around the issue… Not sure if it is bullet proof but it dropped the warning.

//Changed This line
CGSize neededSize = [self.titleLabel.text sizeWithFont:self.titleLabel.font ];

//To this
NSDictionary* attribs = @{NSFontAttributeName:self.titleLabel.font};
CGSize neededSize = [self.titleLabel.text sizeWithAttributes:attribs];
odrobnik commented 10 years ago

@BenGlobism I used your code wrapped in an ifdef since this deprecation only concerns you if you have a deployment target >= iOS 7

odrobnik commented 10 years ago

Fixed and merged.