Post

Replies

Boosts

Views

Activity

Reply to delete green (+) icon when onInsert
example code struct ContentView: View {   @State private var dragging: Ramen?   @State private var ramens = [Ramen(name: "ramen", id: 0),          Ramen(name: "ramen2", id: 1),          Ramen(name: "ramen3", id: 2)]   var body: some View {     List {       ForEach(ramens) { ramen in         Image(ramen.name)           .onDrag {             self.dragging = ramen             return NSItemProvider(object: String(ramen.id) as NSString)           }       }       .onInsert(of: [.text], perform: insert)     }   }   private func insert(index: Int, _: [NSItemProvider]) {     ...   } }
Oct ’21