File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,14 +101,16 @@ - (void)addTextInputObservers
101101 [_markdownTextFieldObserver textFieldDidChange: _textField];
102102
103103 if (@available (iOS 16.0 , *)) {
104- std::string text = " txet" ;
105- std::reverse (text.begin (), text.end ());
106- NSTextStorage *textStorage = [_textField valueForKey: [NSString stringWithFormat: @" %s Storage" , text.c_str ()]];
107- NSTextContainer *textContainer = [_textField valueForKey: [NSString stringWithFormat: @" %s Container" , text.c_str ()]];
108- NSTextLayoutManager *textLayoutManager = [textContainer valueForKey: [NSString stringWithFormat: @" %s LayoutManager" , text.c_str ()]];
109-
104+ auto key = [](std::string s) {
105+ std::reverse (s.begin (), s.end ());
106+ return @(s.c_str ());
107+ };
108+
109+ NSTextContainer *textContainer = [_textField valueForKey: key (" reniatnoCtxet_" )];
110+ NSTextLayoutManager *textLayoutManager = [textContainer valueForKey: key (" reganaMtuoyaLtxet_" )];
111+
110112 _markdownTextLayoutManagerDelegate = [[MarkdownTextLayoutManagerDelegate alloc ] init ];
111- _markdownTextLayoutManagerDelegate.textStorage = textStorage ;
113+ _markdownTextLayoutManagerDelegate.textStorage = [_textField valueForKey: key ( " egarotStxet_ " )] ;
112114 _markdownTextLayoutManagerDelegate.markdownUtils = _markdownUtils;
113115 textLayoutManager.delegate = _markdownTextLayoutManagerDelegate;
114116 }
You can’t perform that action at this time.
0 commit comments