MBProgressHUD icon indicating copy to clipboard operation
MBProgressHUD copied to clipboard

Text sizes calculated using deprecated methods

Open fabianofrancesconi opened this issue 13 years ago • 6 comments

sizeWithFont will be deprecated in iOS 7; furthermore, the behavior now is a little bit different: a label having empty text has still height > 0. Before this wasn't happening.

Please refer to commit de3b6426731e2b09270f941ebbed5220e76bf327

fabianofrancesconi avatar Jun 29 '13 16:06 fabianofrancesconi

Thank you for bringing this up. The code you referenced can't be directly applied as it's currently, as it's using iOS 7 only API, which would brake backwards compatibility. Some more thought (conditional code) will need to be put into this.

matej avatar Jun 29 '13 20:06 matej

You are correct, I didn't notice that boundingRectWithSize was a iOS 7 only method.

How can we check whether that method exists in iOS 6? How can we switch to the proper method at run-time? I guess this is not really possible (unless we use NSInvocation).

fabianofrancesconi avatar Jun 29 '13 21:06 fabianofrancesconi

respondsToSelector: would be one way to sniff out available functionality

coryallegory avatar Jun 30 '13 17:06 coryallegory

Yes. I'll push some iOS 7 related fixes soon.

On 30. jun. 2013, at 19:54, Cory Metcalfe [email protected] wrote:

respondsToSelector: would be one way to sniff out available functionality

— Reply to this email directly or view it on GitHub.

matej avatar Jun 30 '13 17:06 matej

Here's my take on this. Currently still in a side branch. I decided to use preprocessor macros instead of respondsToSelector:, since the later wouldn't prevent the deprecation warnings when setting a deployment target to iOS 7 or later.

matej avatar Jun 30 '13 19:06 matej

This has been fixed a while ago.

matej avatar Aug 12 '14 06:08 matej