William Jockusch
William Jockusch

Reputation: 27295

iPhone -- getting the adjusted font size of a UITextField

I have a UITextField with the adjustsFontSizeToFitWidth property set to YES. I want to get ahold of the current (adjusted) font size. Is that possible?

If not, getting ahold of the actual width of the text (in the adjusted size) would be almost as good.

Upvotes: 3

Views: 599

Answers (3)

Shai Mishali
Shai Mishali

Reputation: 9382

Here's a small snippet/extension I wrote down to handle this.

http://swiftstub.com/134886004/

Upvotes: 0

tc.
tc.

Reputation: 33592

I don't think it's possible, but it should not be too difficult to write your own class.

Upvotes: 1

tadejsv
tadejsv

Reputation: 2092

In the adjusted size, the width of the text would be the same as the width of the text field.

Upvotes: 1

Related Questions