How to use NSSpellChecker and NSTextCheckingController?

I have been looking for information on how to implement NSSpellChecker and NSTextCheckingController the last couple of days and have come up empty. Does anybody of some information using these two AppKit API's or even better an example on using them with an IBOutlet text field?

I understand Apple use to make available the source code for textEdit app? Does anybody know if this is still the case?

Thanks
Answered by BigEagle in 664035022
It turns out if I use a NSTextView object instead of NSTextField object the spelling and grammar are built in. So, all I had do to was the following:

create a scrollable text view object and then connect the TextView as follows:
 @IBOutlet var itemDescription: NSTextView!

Then turn on continuous spell checking with
 itemDescription.isContinuousSpellCheckingEnabled = true


There is a reference at

https://developer.apple.com/videos/play/wwdc2019/210/

At 12'30, they address NSSpellChecker and NSTextCheckingController

But just very light overview, no code sample.

All I have found is related to NSSpellChecker
https://stackoverflow.com/questions/48535123/how-to-make-nsspellchecker-work-with-nsdocument.

You should ask to Apple support as well.
Thanks Claude,

The WWDC video had some other items of interest as well as NSTextCheckingController, however as you said "light overview" but somewhat helpful.

I think I will take you suggestion and talk with apple support as I am mainly interested in NSTextCheckingController since it is the newer API.
That will be great to publish here if you get something interesting.

You could also file a bug report against documentation which is critically absent.

Good luck.
Accepted Answer
It turns out if I use a NSTextView object instead of NSTextField object the spelling and grammar are built in. So, all I had do to was the following:

create a scrollable text view object and then connect the TextView as follows:
 @IBOutlet var itemDescription: NSTextView!

Then turn on continuous spell checking with
 itemDescription.isContinuousSpellCheckingEnabled = true


Thanks for the feedback. I will archive the thread.

Don't forget to close it.
How to use NSSpellChecker and NSTextCheckingController?
 
 
Q