I have a simple layout consisting of NSView and its NSTextView routine. NSTextView is programmatically filled with text that spawns multiple lines. I bind everything together using automatic layout (everything is done programmatically). However, when everything is displayed, NSTextView is disabled, only one row is displayed.
After searching the Internet, the best answer I could find was:
Using Autolayout with the NSTextViews Extension
However, this only works if I manually change the text in the NSTextView after everything is displayed (which is actually not my use case). Views are reconfigured and the entire NSTextView is displayed.
I am trying to figure out when the NSViewController is executing with subviews highlighting so that I can call invalidateIntrinsicContentSize on an NSTextView. Equivalent to viewDidLayoutSubviews in a UIViewController.
So far I have not tried anything. I tried calling invalidateIntrinsicContentSize for NSTextView:
- At the end of
loadView - After I filled NSTextView with my text
Is there a better way to achieve this?
source share