# Chapter 2 challenge solution

**URL:** <https://forums.kodeco.com/t/chapter-2-challenge-solution/200731>\
**Category:** Modern Concurrency in Swift\
**Created:** [December 20, 2023, 2:43pm UTC](https://forums.kodeco.com/t/chapter-2-challenge-solution/200731 "2023-12-20T14:43:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![omarelsayed](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@omarelsayed](https://forums.kodeco.com/u/omarelsayed)\
**Post date:** [December 20, 2023, 2:43pm UTC](https://forums.kodeco.com/t/chapter-2-challenge-solution/200731/1 "2023-12-20T14:43:59Z")

</div>

Task {  
isDownloadActive = true  
fileData = try await model.download(file: file)  
isDownloadActive = false  
}  
this was the solution for the challenge in chapter 2, What I did was the above code and it worked. I feel like the solution is better but I don’t quit understand way @icanzilb  
isDownloadActive = true  
Task {  
do {  
fileData = try await model.download(file: file)  
} catch { }  
isDownloadActive = false  
}
