One Logo Pool Ball
SwiftUI · IOS API REFERENCE

RenameButton

struct · iOS 16.0+ · SDK 27.1

nonisolated struct RenameButton<Label> where Label : View

A button that triggers a standard rename action. A rename button receives its action from the environment. Use the ``View/renameAction(_:)`` modifier to set the action. The system disables the button if you don't define an action. struct RowView: View { @State private var text = "" @FocusState private var isFocused: Bool var body: some View { TextField(text: $text) { Text("Prompt") } .focused($isFocused) .contextMenu { RenameButton() // ... your own custom actions } .renameAction { isFocused = true } } } When someone taps the rename button in the context menu, the rename action focuses the text field by setting the `isFocused` property to true. You can use this button inside of a navigation title menu and the navigation title modifier automatically configures the environment with the appropriate rename action. ContentView() .navigationTitle($contentTitle) .toolbarTitleMenu { // ... your own custom actions RenameButton() }

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

RenameButton.init()

The iOS SDK compiler rejected this binding: initializer 'init()' requires the types 'AnyView' and 'Label<Text, Image>' be equivalent

RenameButton.body

This protocol needs associated types that cannot yet cross the bridge.

All SwiftUI types →