I'm attempting to create an editor in SwiftUI which can handle novel level word counts (50,000-100,000 words).
In the most bare bones example:
struct TextEditingView: View {
@State private var fullText: String = "This is some editable text..."
var body: some View {
TextEditor(text: $fullText)
.foregroundColor(Color.gray)
.font(.custom("HelveticaNeue", size: 13))
.lineSpacing(5)
}
}
At around 3000-5000 words or so on an iPad + keyboard I experience huge amounts of latency, and stranger behaviors (like the view scrolling randomly). I experience similar things on macOS and iPhone.
I've tried to search for terms like Buffered TextEditor SwiftUI
or TextEditor paging SwiftUI
without much success.
It seems most implementations of text editors in swift can't really support this sort of document size, though Apple's notes seems to be able to handle it.
Can someone point me in the right direction?