Working with text is undoubtedly one of the most frequent and important tasks in our development projects. In your projects, it can be a comment field, creating notes, or even a full-fledged editor. SwiftUI offers the ability to use the TextEditor. Despite it not being as powerful as UITextView, it is more than enough for most use cases.
Apple's official documentation provides an overview of TextEditor and its capabilities. If you're looking for more advanced features and examples of use, this article provides a detailed explanation of how to implement a find/replace function, among others.
For a simplified example of how to implement TextEditor, I can recommend checking out this GitHub repository. The iOS Dev community has also shared valuable insights and best practices for working with TextEditor.