I tried using sizeWithAtrributes
but it just breaks, not sure what I'm doing wrong this is the error that come up sizeWithFont:minFontSize:actualFont:forWidth:lineBreakMode:
is deprecated in iOS7:
if (theRect.size.width > self.bounds.size.width - rightIconNeeds - leftIconNeeds) {
CGFloat finalSize = realLabel.font.pointSize;
theRect.size = [realLabel.text sizeWithFont:realLabel.font
minFontSize:realLabel.font.pointSize * realLabel.minimumScaleFactor
actualFontSize:&finalSize
forWidth:self.bounds.size.width - rightIconNeeds - leftIconNeeds
lineBreakMode:realLabel.lineBreakMode];
}