NSTextView.shouldDrawInsertionPoint doesn't work with TextKit 2

The following code only ever causes shouldDrawInsertionPoint to be printed (no drawInsertionPoint), but even if that method returns false, the blinking insertion point is still drawn. On the other hand, with TextKit 1 it works as expected.

Is there a way to hide the default insertion point in TextKit 2? My app draws its own.

I've filed FB13684251.

class TextView: NSTextView {
override var shouldDrawInsertionPoint: Bool {
print("shouldDrawInsertionPoint")
return false
}
override func drawInsertionPoint(in rect: NSRect, color: NSColor, turnedOn flag: Bool) {
print("drawInsertionPoint", flag)
}
}
``
Answered by DTS Engineer in 833261022

Hi and thanks for filing a bug report. I checked the status today and there's a note asking you to test with the most recent beta. To avoid your bug report being closed, please do some testing and update your bug when you have a chance.

Please continue to test your software in release and pre-release versions of system software made available to you through your developer.apple.com account. When you do, add details about that into your bug report to keep it up to date. Please see https://developer.apple.com/download/.

Hi and thanks for filing a bug report. I checked the status today and there's a note asking you to test with the most recent beta. To avoid your bug report being closed, please do some testing and update your bug when you have a chance.

Please continue to test your software in release and pre-release versions of system software made available to you through your developer.apple.com account. When you do, add details about that into your bug report to keep it up to date. Please see https://developer.apple.com/download/.

Sorry, I copied the wrong number. That one had the same title but was actually addressing TextKit 1. The correct number is FB17103305.

No problem. Thanks for the update. I checked in your FB17103305 report and it is up to date and has been routed to the correct engineering team. No news yet. Your Feedback report remains open and under investigation. I'll check back again later.

NSTextView.shouldDrawInsertionPoint doesn't work with TextKit 2
 
 
Q