in iOS15, refreshable is introduced!
Post
Replies
Boosts
Views
Activity
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]) {
...
}
}
when dragging
I couldn't figure out how to change it with onInsert, but I did find out that DropProposal is involved.
By implementing it with onDrop, I was able to successfully turn it off.
I quit the simulator once and started it again, and it fixed the problem. The cause is unknown.
As far as I can tell, the only way to display the message is to use fatalError.
supplement:
repository.delete(id: "2") is doing realm delete transaction.
repository.object is getting realm object.
Thank you for your reply!
There is also a difference in the captured image.