@FocusState private var isFocused: Bool
@State private var text = "Tap, touch and hold, or swipe left to rename"

var body: some View {
    TextField(text: $text) {
        Text("Tap, touch and hold, or swipe left to rename")
    }.focused($isFocused)

    RenameButton()
        .swipeActions(edge: .trailing) {
            RenameButton()
        }.contextMenu {
            RenameButton()
        }.renameAction {
            isFocused = true
        }
}

Get New Tutorials by Email

No spam. Just clear, practical breakdowns you can apply right away.

Enjoy this tutorial?

Get new practical tech tutorials in your inbox.