my solution was to wrap a UITextView in UIViewRepresentable. You can implement the new sizeThatFits API in UIViewRepresentable to ensure that the view sizes itself to fit its UIView content.
Edit:
Also using a TextField with a vertical growing axis seems to work as well. But the return button seems to submit the text field rather than adding new lines like one would expect.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: