iPhone SwiftUI layouts

Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.

List

Edit Button

A button that toggles the edit mode environment value.

Explore Edit Button on iPhone in portrait, with SwiftUI code and Apple API documentation.

@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()
  }
}
}
iOS 13.0+ iPadOS 13.0+ visionOS 1.0+

Every available iPhone screenshot for Edit Button.

1 views