Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Created October 20, 2023 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzyzanowskim/33a2478fa2281b77816acb7a7f6f77ac to your computer and use it in GitHub Desktop.
Save krzyzanowskim/33a2478fa2281b77816acb7a7f6f77ac to your computer and use it in GitHub Desktop.
FB13291926: NSTextLayoutManager.usageBoundsForTextContainer observer is never trigerred

I noticed that NSTextLayoutManager.usageBoundsForTextContainer is no longer KVO observable, despite being documented as KVO-compliant.. I believe it worked around macOS 13.

var usageBoundsForTextContainerObserver: NSKeyValueObservation?

usageBoundsForTextContainerObserver = textLayoutManager.observe(\.usageBoundsForTextContainer, options: [.new]) { textLayoutManager, change in
    print("never called")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment