-1

Can anybody tell me What is the alternative method for - (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size in ios 7?

This method is deprecated in ios 7. What method should I use that can return the size of string?

rmaddy
  • 307,833
  • 40
  • 508
  • 550
Pankti Patel
  • 296
  • 1
  • 4
  • 14
  • 1
    possible duplicate of [With what should I replace the deprecated sizeWithFont:contrainedToSize:lineBreakMode method?](http://stackoverflow.com/questions/18315441/with-what-should-i-replace-the-deprecated-sizewithfontcontrainedtosizelinebrea) – Kevin Sep 23 '13 at 14:10

1 Answers1

2

A quick google search gives this as the first sugestion. never writen anything for ios myself so i dont know if this helps you.

 (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes context:(NSStringDrawingContext *)context 

And here is where i found it: http://www.leapingbytes.com/blog/version_proofing_your_code_arc_twist

Ørjan Johansen
  • 385
  • 2
  • 9