Problem: When I tap a song in PlaylistView, I want to navigate to PlayerPlaylistView and play that song. But I get the error:
Missing argument for parameter 'selectedAudioURL1' in call
App setup:
3 tabs: Home, Playlist, Settings
PlaylistView is supposed to pass selectedAudioURL1 to PlayerPlaylistView using a @Binding.
File 1 – PlayerView:
.navigationDestination(isPresented: Binding(
get: { selectedTab == "playlist" },
set: { isActive in
if !isActive { selectedTab = "home" }
}
)) {
PlaylistView() // ❗️Missing argument for 'selectedAudioURL1'
}```
File 2 – PlayerPlaylistView:
TabBarButton(imageName: "Playlist", text: "Playlist", isSelected: selectedTab == "playlist")
.onTapGesture { selectedTab = "playlist" }
.background(
NavigationLink(
destination: PlaylistView(), // Missing argument for 'selectedAudioURL1'
isActive: Binding(
get: { selectedTab == "playlist" },
set: { if !isActive { selectedTab = "home" } }
)
) { EmptyView() }.opacity(0)
)