I am new to SwiftUI,I tried to put the extra code into the function, but I get some error message and I don't know how to fix:
'some' types are only implemented for the declared type of properties and subscripts and the return type of functions
My code:
func test() -> ToolbarItem<Void, some View> {
return ToolbarItem(direction: .right) {
Label("", systemImage: "icloud.and.arrow.up.fill")
.foregroundColor(.white)
.frame(width: itemWith, height: 30, alignment: .center)
}
}
Does anyone know how to do this? thank you