There is not much to add to what the question is already asking.
How to limit the linenumber to a Textfield in SwiftUI? The following does not work
TextEdi