struct ContentView: View {
func saveIdsWatchedTime(memetime: Int) async {
print("result:")
print(memetime)
}
var body: some View {
VStack{
SubView(saveIdsWatchedTime: saveIdsWatchedTime)
}
}
}
struct SubView: View {
let saveIdsWatchedTime(memetime: Int) -> Void
var body: some View {
Text("bla")
.onTapGesture {
Task.detached(priority:.background){
await saveIdsWatchedTime(memetime: 123)
}
}
}
}
< /code>
Сообщение об ошибке: < /p>
Consecutive declarations on a line must be separated by ';'
для let saveIdswatchedtime
Как сделать это правильно?
var body: some View { Text("bla") .onTapGesture { Task.detached(priority:.background){ await saveIdsWatchedTime(memetime: 123) } } } } < /code> Сообщение об ошибке: < /p> Consecutive declarations on a line must be separated by ';' [/code] для let saveIdswatchedtime Как сделать это правильно?