If I set an exclusion path, e.g. in TextDocumentViewController.viewDidLoad() like:
textLayoutManager.textContainer?.exclusionPaths = [bezierPath]
I am getting a "Unexpectedly found nil while unwrapping an Optional value" crash in TextDocumentView.adjustViewportOffset() because viewportRange is nil on textViewportLayoutController.
Setting an exclusion path also causes weird behavior for textLayoutManager.enumerateTextLayoutFragments() which refuses to iterate if the .ensuresLayout option is set.
The problem happens in both iOS and macOS (though I only care about iOS). I'm able to get exclusionPaths to work fine if I use UITextView, but the performance is unworkable there.
I also was able to set exclusionPaths in the STTextView project in GitHub, but I was unable to identify anything specific that code was doing differently.
Anyone have ideas as to what else needs to happen to make exclusionPaths work?