Post

Replies

Boosts

Views

Activity

Reply to SwiftUI, List items reordering issue (iOS 16)
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() } }
Oct ’22
Reply to UITableView Drag and Drop to Move Row Does Not Work
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))] }
Sep ’20