Hi All,
I'm quite new to swift and am wondering why I am receiving a "Trailing closure passed to parameter of type 'Visibility' that does not accept a closure"
error on the .toolbar{
line
I Have Supplied My Code Below
Thanks in Advance,
Josh
struct HomeView: View {
var body: some View {
Text("Home")
.toolbar{
ToolbarItem(placement: .navigationBarLeading)
Button(action: NavigationLink(destination: AccountView()), label: Image(systemName: "gearshape"))
ToolbarItem(placement: .principal) { Text("Welcome").font(.title)
}
ToolbarItem(placement: .navigationBarTrailing)
Button(action: NavigationLink(destination: AccountView()), label: Image(systemName: "person.circle"))
}
.navigationBarTitleDisplayMode(.inline)
}
}
struct HomeView_Previews: PreviewProvider {
static var previews: some View {
HomeView()
}
}```