Viewing console output
You can use the print
function to write information to the console, which is very useful for debugging. If you have not yet used the console in Xcode, follow these simple steps to view it:
In the upper right-hand corner of Xcode, make sure that the debug area is turned on, as shown in the following screenshot:
In the bottom right-hand corner of Xcode, make sure that the console is turned on, as shown in the following screenshot: