Edit Button

A button that toggles the edit mode environment value.

Edit Button - iOS Light Mode Preview

Platform Compatibility

iOS 13.0+ iPadOS 13.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
@State var items = ["Foo", "Bar"]

var body: some View {
  NavigationView {
    List {
      ForEach(items, id: \.self) { item in
      Text(item)
    }
    .onDelete { _ in action() }
    .onMove { _, _ in action() }
  }
  .toolbar {
    EditButton()
  }
}
}

Found an issue or have a suggestion?

Created: August 11, 2025Updated: August 11, 2025