Skip to content

[SWIFT-UI ]How do I change the content in the floating panel depending on changes in another Swift-UI View #672

@SvenMuc

Description

@SvenMuc

I want to overlay the floating panel over a map view and change the content depending on selection in the map view or in the ClubList().
My main problem is, that the .floatingPanelis not updated when I change the selectedLocation.

I tried to use the MyPanelCoordinator and see that the onUpdate method is called when I change the selectedLocation attribute. But how to I trigger the update of the .floatingPannel view?

Exemplary view.

MyMapView()
    .floatingPanel(coordinator: MyPanelCoordinator.self) { proxy in
        if selectedLocation == nil {
            ClubList(selection: $selectedLocation)
                .padding(.top, 15)
        } else {
            ClubDetailedMapView(club: selectedLocation)
                .padding(.top, 15)
        }
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions