We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71c2b7f commit 8cc4a2fCopy full SHA for 8cc4a2f
README.md
@@ -17,8 +17,17 @@ Basic code to make it work:
17
18
// setup the system
19
let textStorage = ParagraphTextStorage()
20
+ textStorage.paragraphDelegate = self
21
+
22
let layoutManager = NSLayoutManager()
23
textStorage.addLayoutManager(layoutManager)
24
25
+ let textContainer = NSTextContainer(containerSize: .zero)
26
+ layoutManager.addTextContainer(textContainer)
27
28
+ let textView = NSTextView(frame: someFrame, textContainer: textContainer)
29
+ someScrollView.documentView = textView
30
31
32
If you need to sync your model with ParagraphTextStorage content, set the paragraphDelegate to adopt the ParagraphTextStorageDelegate protocol.
33
It's just two methods:
0 commit comments