I want to use the custom layout manager for a textview that is referenced from storyboard. I know that we can subclass the NSLayoutManager and assign the layout to textview in code but I want to use the textview from storyboard.
I found in NSTextcontainer class there is a method
func replaceLayoutManager(_ newLayoutManager: NSLayoutManager) to replace the layout manager
but I don't know how to use it for the textview created in the storyboard. kindly let me know is there is way to assign the custom layout manager for the textview created in storybard.
Can't you just add a reference to the text view in your view/view controller and call the
replaceLayoutManagerfunction on it?Or don't you have any code connected to your storyboard? In that case you could subclass
UITextView, overrideawakeFromNiband provide your custom layout manager in there. Then, use reference your subclass type in the storyboard.