Sobes.tech
Senior

нека родителят бъде Task { let child = Task { print("дете започна, isCancelled = ", Task.isCancelled) // for index in (1...[phone]) { print(index) } print("дете приключи, isCancelled = ", Task.isCancelled) // } await child.value } try? await Task.sleep(nanoseconds: 1_000_000_000) // 1 секунда parent.cancel()