Post

Replies

Boosts

Views

Activity

Navigation in IPad SplitView in iOS 14.5 beta is completely broken
I have tested the iOS 14.5 beta and discovered that there are now serious issues in apps that use two column layout in iPad. The issues can be seen if such an app is first used in splitview mode and the app is returned to full size. The issues include: missing Back-button in navigationBar. the views change place. Views that originally located in the right column are now moved to sideBar. This looks really weird and really broken. also the navigationLinks remain highlighted when the app is used in the splitview mode. I have left feedback to Apple with feedback Assistant, but I fear that this is not fixed before the iOS 14.5 release. You can reproduce the issue with these steps: Create a new app and replace the ContentView with my code block. Open the sample app with any iPad simulator running iOS 14.5 beta 3 in Xcode 12.5 Beta 3 Drag another app alongside the sample app and in split view so that the sample app becomes as narrow as possible. Navigate to last view in sample app. Exit the split view mode by making the sample app full window size again Now you see how broken the sample app is. If you use iOS 14.4 simulator, the app has no problems. struct ContentView: View {     var body: some View {             NavigationView{                     View1()                     Text("Select View")             }         .NavigationViewStyle(DoubleColumnNavigationViewStyle())     } } struct View1: View {     var body: some View {         List {             NavigationLink(                 destination: View2(),                 label: {                     Text("Show View2")             })         }     } } struct View2: View {     var body: some View {             List {                 NavigationLink(                     destination: View3(),                     label: {                         Text("Navigate to View3")                 })             }     } } struct View3: View {     var body: some View {         List {             NavigationLink(                 destination: Text("View4"),                 label: {                     Text("Navigate to View4")             })         }     } }
5
0
1.3k
Mar ’21
Prevent drag when moving list rows on iPad
I have a SwiftUI list. I want rows to be selectable and movable so they can be rearranged on the list. The code to implement this is pretty straightforward, but there is a major caveat. On iPhone everything works as intended. However on iPad I can't rearrange rows if there are multiple rows selected, instead the selected rows become draggable. Is there any way to disable dragging behaviour? The whole code is here. Run it both in iPhone- and iPad-simulator and you can replicate the behaviour. import SwiftUI struct ContentView: View { @State private var selectedRows = Set<String>() @State private var items = ["item1", "item2", "item3", "item4"] var body: some View {         List(selection: $selectedRows) {             ForEach(items, id: \.self) { item in                 Text(item)             }             .onMove(perform: onMove)         }         .listStyle(InsetGroupedListStyle())         .environment(\.editMode, Binding.constant(.active)) }     func onMove(source: IndexSet, destination: Int) {         guard let index = source.first else { return }         let newIndexSet = IndexSet([index])         items.move(fromOffsets: newIndexSet, toOffset: destination)     } }
0
0
933
Dec ’20