It is a little strange that UITextView doesn't have a convenience property for this. However, you can still access it easily enough via the textLayoutManager's .textContentManager property (NSTextContentStorage being the concrete subclass of NSTextContentManager used by NS/UITextView). And of course you could create an extension to UITextView to add the .textContentStorage property yourself:
extension UITextView {
var textContentStorage: NSTextContentStorage? {
return textLayoutManager?.textContentManager as? NSTextContentStorage
}
}
Hopefully Apple will add this, though, as it would be useful. (I've filed an enhancement request: #FB10376167.)