Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift Basics (retired) Types Printing Results

What is the main function of the "console"?

I understand thats where all the print/println functions end up, but it seems that the console has functionalities that I didn't understand. Thank you!

3 Answers

Hi Jorge!

The console class is in charge of everything to do with the console! It has functions which print to the console and etc.

I hope this helped clear it up a bit. I know it is a simple answer but that is essentially it!

-Luke

Hi Luke, Thanks for the fast response. Maybe I'm not understanding, why would we want to open up the console like we did in this video? Does it check for errors in our code? What is the purpose of the console? If you did answer my question in your response, I didn't understand, feel free to dumb it down for me.

The console is usually used to write pieces of information from the program for the developer. I do it often when I am writing programs so that I can see if a certain piece of code is running and also to see the values of different variables!

Feel free to ask any more questions you may have!

-Luke

The console is what will save you at the end of the day. You will need to make sure that your app is functioning as it should, and the console is there to inform you of such. It will tell you what errors you have in your code, the responses to hardcoded queries you have placed in your code, view layout issues, responses from servers, etc. etc. It is a fine piece of work. So as long as you are an iOS developer, use your console for everything you do. Then again, you will soon see that it's almost impossible not to.