Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Picker on iPadOS 15 beta 8
For anyone else running into this, it's not hard to convert from a Picker with MenuPickerStyle to a Menu. I went ahead and converted the above to demonstrate: struct OuterView: View {     @State var colorViewModel = ColorViewModel()     var body: some View {         ColorView(colorViewModel: colorViewModel)     } } class ColorViewModel: ObservableObject {     @Published var colors = ["yellow", "green", "blue"]     @Published var selectedColor = "Select a color" } struct ColorView: View {     @ObservedObject var colorViewModel: ColorViewModel     var body: some View {         VStack {             Menu {                 ForEach(colorViewModel.colors, id: \.self) { color in                     Button(color) {                         colorViewModel.selectedColor = color                     }                 }             } label: { Text(colorViewModel.selectedColor)                 .frame(maxWidth: .infinity, alignment: .leading)                 .padding()             }             .border(Color.black, width: 2)             Text(colorViewModel.selectedColor)         }         .padding()     } } struct ColorView_Previews: PreviewProvider {     static var previews: some View {         OuterView()     } }
Sep ’21
Reply to SwiftUI iOS 14 beta TextField 100% CPU
We have this same issue in our application as well. It's a swiftUI app with a TextField and we see the hang whenever the user taps the TextField and brings up a keyboard. We have verified that in iOS 13 the behavior is not there. In iOS 14.2 beta the behavior seems to be fixed. But in iOS 14 and 14.0.1 we are seeing 100% CPU and memory allocations increasing in some sort of busy loop. We have a very similar layout to a previous comment: Not sure if this adds more context, but I have a TabView, which contains a NavigationView, which contains a view with a TextField. We have a TabView hosting a UISplitViewController hosting a UINavigationController hosting a UIHostingController with a ListView ultimately containing a TextField. Any workarounds or hints would be MUCH appreciated since this bug renders our application unusable.
Sep ’20