Melodius
Melodius

Reputation: 2785

How to get the size of the new swift AttributedString?

NSAttributedString has a size() method which the new AttributedString lacks. How do you get the size of the new AttributedString?

Upvotes: 3

Views: 955

Answers (1)

Claudio
Claudio

Reputation: 5203

You could convert your AttributedString to an NSAttributedString and then call the size method, although this seems more like a workaround.

let myNSAttributedString = NSAttributedString(myAttributedString)
myNSAttributedString.size()

Upvotes: 2

Related Questions