Home / IOS Development / Content menu error: iOSProgramming

Content menu error: iOSProgramming



Have been trying to fix the flashing display error for a while now. Video

My sight:

var body: some View {
        VStack(spacing: .zero) {
            if showCards {
                ScrollView {
                    VStack(spacing: 16) {
                        ForEach(feed.groupTasks) { task in
                            CardVew(title: task.title, description: task.description, name: task.name, task: task.task)
                                .contextMenu(ContextMenu {
                                    Button(action: {
                                        print("test")
                                    }, label: {
                                        Text("Item")
                                    })
                                })
                        }
                    }
                }
                .transition(.move(edge: .leading))
            }
            Spacer()
        }
        .onAppear {
            if feed.groupTasks.count == 0 {
                feed.fetch(for: user.id!, .group)
            }
        }
        .onReceive(feed.$feedData) { feedData in
            if feedData.groupTasks.count > 0 {
                withAnimation(.easeOut(duration: 0.3)) {
                    showCards = true
                }
            }
        }
    }

It also has these modifiers in the parent view:

.animation(Animation.easeOut(duration: 0.25))
.transition(.move(edge: .leading))

Source link