Post

Replies

Boosts

Views

Activity

SwiftUI TextEditor performance issues
Has anyone used the new SwiftUI 2.0 TextEditor with a sizeable string? I'm currently trying it with a 400K text string and typing into the TextEditor horribly slow. Each letter I type takes seconds to appear. When the text size is small (say just a few thousand characters) it's fast - so it's clearly something to do with performance. Is this a known issue? Should I be doing something to improve it? PS - I do need to use it for my app (for e.g., a Markdown editor that loads a large file)  if let t = try? String(contentsOfFile: filePathName, encoding: .utf8) {             editorText = t             Config.logger.debug("EditorView.onAppear: Read text count = \(t.count) characters")             }
4
0
3.2k
Dec ’22
SwiftUI TextEditor performance issues
Has anyone used the new SwiftUI 2.0 TextEditor with a sizeable string? I'm currently trying it with a 400K text string and typing into the TextEditor horribly slow. Each letter I type takes seconds to appear. When the text size is small (say just a few thousand characters) it's fast - so it's clearly something to do with performance. Is this a known issue? Should I be doing something to improve it? PS - I do need to use it for my app (for e.g., a Markdown editor that loads a large file)  if let t = try? String(contentsOfFile: filePathName, encoding: .utf8) {             editorText = t             Config.logger.debug("EditorView.onAppear: Read text count = \(t.count) characters")             }
Replies
4
Boosts
0
Views
3.2k
Activity
Dec ’22