File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 20
20
@implementation SPTextView
21
21
22
22
- (instancetype )init {
23
- NSTextContainer *container = [self setupTextContainer ];
23
+ SPInteractiveTextStorage *textStorage = [[SPInteractiveTextStorage alloc ] init ];
24
+ NSTextContainer *container = [self setupTextContainerWith: textStorage];
24
25
25
26
self = [super initWithFrame: CGRectZero textContainer: container];
26
27
if (self) {
27
-
28
+ self. interactiveTextStorage = textStorage;
28
29
/*
29
30
Issue #188:
30
31
===========
Original file line number Diff line number Diff line change 8
8
9
9
extension SPTextView {
10
10
@objc
11
- func setupTextContainer( ) -> NSTextContainer {
11
+ func setupTextContainer( with textStorage : SPInteractiveTextStorage ) -> NSTextContainer {
12
12
let container = NSTextContainer ( size: . zero)
13
13
container. widthTracksTextView = true
14
14
container. heightTracksTextView = true
15
15
16
- let textStorage = SPInteractiveTextStorage ( )
17
- interactiveTextStorage = textStorage
18
-
19
16
if #available( iOS 16 . 0 , * ) {
20
17
let textLayoutManager = NSTextLayoutManager ( )
21
18
let contentStorage = NSTextContentStorage ( )
You can’t perform that action at this time.
0 commit comments