I see the same behaviour and have filed a bug as FB11680421 (the autogenerated link is missing the final 1) .
Here's some example code to demonstrate the problem. This works in iOS 15 but not iOS 16.
import SwiftUI
struct MoveDisabled: View {
@State private var users = ["user1", "user2", "user3", "user4"]
var body: some View {
List {
ForEach(users, id: \.self) { user in
Text(user)
.moveDisabled(user == "user2" || user == "user3")
}
.onMove { source, index in
self.users.move(fromOffsets: source, toOffset: index)
}
}
.environment(\.editMode, .constant(.active))
}
}
struct MoveDisabled_Previews: PreviewProvider {
static var previews: some View {
MoveDisabled()
}
}
Post
Replies
Boosts
Views
Activity
Thank you for sharing this! I had the exact same problem and ensuring that NSItemProvider was initialised with an object worked for me as well.
Here's my code:
func tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
		return [UIDragItem(itemProvider: NSItemProvider(object: "Move" as NSItemProviderWriting))]
}