More Swifty NSAttributedString Attribute Query Methods
NSAttributedString
API takes an NSRange
by-reference. That’s cumbersome to use, though, because you need to initialize a non-nil range, and there you should initialize it with NSNotFound
to indicate an illegal state. Afterwards, you need to check if the range changed to a legal value.