I have a NSTextView, and I want to forbid users from typing in some specific character like "K", (when "K" is pressed,ignore the input, and don't change the underlying textStorage). is there a way I can do it? appreciate very much
NSTextView ignore specific char input
figure it out
public func textView(_ textView: NSTextView, shouldChangeTextIn affectedCharRange: NSRange, replacementString: String?) -> Bool { if replacementString == "K" { return false }
return true
}