Код: Выделить всё
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 ';'
Как сделать это правильно?
Подробнее здесь: https://stackoverflow.com/questions/794 ... o-sub-view