New Text Editor In SwiftUI

Since iOS 14 there is a new Text Editor implemented in SwiftUI.

Previously we were using TextField and it looked like this.

@State private var text = “Some text… “

TextField(“”, text: $text)

But by default, it was limited to only one line of text.

Now there is TextEditor that takes whole possible area and by default breaks lines.

TextEditor(text: $text)