Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS

Please I Have Question On The Closures

Hi All i hope all is well i have disappointed on the closures i read on it but i still do not know why we use closures in the weather app ? and why we needed in my own app ? can i do weather app and any app without closures ? please any one can help me and explain all theses questions on the closures?

thanks for everyone

1 Answer

Closures are very important because they help us to write asycrinous code. What I understand is that when a function that has a closure as a parameter will only perform the code inside the curly braces when the task that you passed when declared that function had been finished.Hope you understand, I am on my phone right now so it is impossible to answer with some examples

Thank you very much lgor