Created
July 20, 2022 19:44
-
-
Save christianselig/3de70edb24496cea4b3f19413ec73f61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
List { | |
ForEach(0 ..< 5, id: \.self) { index in | |
Button { | |
print("Tapped index \(index)") | |
} label: { | |
HStack { | |
Image(systemName: "plus.circle.fill") | |
Text("Drag to Reorder or Tap to Add") | |
.foregroundColor(.primary) | |
} | |
} | |
} | |
.onMove(perform: { _, _ in }) | |
.listRowInsets(.init(top: 0.0, leading: -25.0, bottom: 0.0, trailing: 0.0)) | |
} | |
.environment(\.editMode, .constant(.active)) | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment