iComputerfreak

iOS 16 bug

Sep 26th, 2022
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. Tested on iOS 16.0 / Xcode 14.0 App Store version
  2.  
  3. Description:
  4. When using a NavigationSplitView with multiple selection, the view sometimes selects previously selected items and thereby unexpectedly activates detail views.
  5.  
  6. Code Sample:
  7. struct ContentView: View {
  8. @State private var selectedItems: Set<Int> = .init()
  9.  
  10. var body: some View {
  11. VStack {
  12. NavigationSplitView {
  13. List(0..<10, selection: $selectedItems) { i in
  14. Text("Item \(i)")
  15. }
  16. .navigationTitle("Root")
  17. .toolbar {
  18. ToolbarItem(placement: .navigationBarTrailing) {
  19. EditButton()
  20. }
  21. }
  22. } detail: {
  23. Text("Detail \(String(describing: selectedItems))")
  24. .navigationTitle("Detail")
  25. }
  26. Text("Selected Items: \(String(describing: selectedItems))")
  27. }
  28. }
  29. }
  30.  
  31. Steps to reproduce (using the above code sample):
  32. - Run the app on an iPhone or in the iPhone Simulator
  33. - Select an arbitrary item (let's say Item 2)
  34. - Go back to the root view
  35. - Tap the Edit button
  36. - Select at least one item
  37. - Without deselecting the item, tap the Done button
  38. - The app will present the detail view for Item 2 without the user tapping on it
  39.  
  40. Expected Behavior:
  41. I expected the app to not activate any detail views, as the user did not tap any items and no detail views were visible before entering edit mode.
  42.  
  43. Actual Behavior:
  44. The app activated a previously active detail view.
  45.  
  46. The bug occurs independent of the device and also occurs in the Simulator.
  47. I verified it on my iPhone 13 running the public release of iOS 16.0 and observed the same behaviour.
  48. I also attached a screen recording of the bug in the simulator.
  49.  
Advertisement
Add Comment
Please, Sign In to add comment