swiftui Alert Missing argument for parameter 'text' in call

Asked 1 years ago, Updated 1 years ago, 279 views

When swiftui tries to navigate from ContentView to the side menu,

SideMenuView (isOpen:$isOpenSideMenu)

If you write

Missing argument for parameter 'text' in call

and

Insert', text:<#Binding<String>#>'

The error appears.

#Binding<String>

Do you need ?

I added #Binding<String>, but I don't want to because it's extra.

swift

2022-11-05 19:30

1 Answers

I don't know what SideMenuView is, but the argument text is not optional.

However, there is also a way to initialize.

SideMenuView(isOpen:$isOpenSideMenu, text:.constant(""))


2022-11-05 19:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.