Post

Replies

Boosts

Views

Activity

Reply to Deleting core data entity from inside a withAnimation block causes concurrency violation
Here are the error message: CoreData`+[NSManagedObjectContext Multithreading_Violation_AllThatIsLeftToUsIsHonor]:     0x1cddb5424 <+0>:  pacibsp      0x1cddb5428 <+4>:  stp    x29, x30, [sp, #-0x10]!     0x1cddb542c <+8>:  mov    x29, sp     0x1cddb5430 <+12>: bl     0x1d2bfcfb0 ->  0x1cddb5434 <+16>: brk    #0x1 com.apple.SwiftUI.AsyncRenderer (15): EXC_BREAKPOINT (code=1, subcode=0x1cddb5434)
Dec ’22
Reply to Disable background taps while SwiftUI Menu is active?
I have the same issue: Here is my code: Menu {                 Picker("Topic", selection: $selectedTopic) {                     Text("Unassigned")                         .tag(nil as Topic?)                     Divider()                     ForEach(topics, id:.id) { topic in                         Text(topic.name!).tag(topic as Topic?)                             .foregroundColor(topic.foregroundColor)                     }                 }             }                      label: {             Image(systemName: "circle.grid.3x3.circle")                 .font(.system(size: 26,weight: .ultraLight))                 .foregroundColor(learningSet.topic?.foregroundColor ?? .primary)                 .frame(width:30, height: 30)         } This correctly shows the menu and if I select an item, the .onchange fires like it should. Problem is if the user clicks on some other view on the screen while the is active, it fires that views .onTappedGesture. I tried different combinations of highPriorityGesture and SimultaneousGesture to no avail. I also tried the approach of adding a full screen view In between the view with the menu and the underlying views and added an onTap to it. That approach works fine with one issue: If the user click on the currency selected item, the .onChange for the picker doesn't fire, the menu disappears but its .onDisappear doesn't fire. So there is no way to know the menu is no longer visible, and hide my full screen view. Any help would be greatly appreciated. Thanks.
Dec ’22