nechte rodiče být Task {
let child = Task {
print("dítě začalo, isCancelled = ", Task.isCancelled) //
for index in (1...[phone]) {
print(index)
}
print("dítě skončilo, isCancelled = ", Task.isCancelled) //
}
await child.value
}
try? await Task.sleep(nanoseconds: 1_000_000_000) // 1 sekunda
parent.cancel()