Swift iOS 24-Hour Trainer. Mishra Abhishek
Чтение книги онлайн.
Читать онлайн книгу Swift iOS 24-Hour Trainer - Mishra Abhishek страница 7
Each file with one or more errors/warnings is represented by a root-level node in a tree-like structure. Expanding the node reveals the exact positions within that file where these errors/warnings were encountered.
The Test Navigator
The test navigator (Figure 2.12) gives you a snapshot of all the unit tests created with the project. A root-level node in a tree-like structure represents each test suite. Expanding this node reveals the test fixtures within that test suite. Clicking a test fixture (method) will open the corresponding code in the editor area. To run a test, you could click the play icon to the right of the test fixture.
The Debug Navigator
The debug navigator is used during an active debugging session and lists the call stack for each running thread. Debugging is an advanced topic and is not covered in this book.
The Breakpoint Navigator
The breakpoint navigator lists all breakpoints in your code and allows you to manage them. A breakpoint is an intentional pause-point that you can set in your project. When the app is being executed, Xcode interrupts the execution of the application when it encounters one of these pause-points and transfers control to the debugger. This is extremely useful when trying to figure out why a particular piece of code does not work and you want to inspect the values of variables and content of memory. Breakpoints and the debugger work only when the application is being executed in debug mode. Breakpoints and debugging are advanced topics, and are not covered in this book.
The Report Navigator
The report navigator shows you a history of build logs and console debug sessions. Building is the complete process of creating an executable application from your source code files. Compilation is a part of the build process. Each time you build a new executable, Xcode creates a build log that contains, among other things, a list of files that were compiled.
The Editor Area
The right side of the workspace window is the editor area (Figure 2.13). Xcode includes editors for many file types, including source code, user interface files, XML files, and project settings, to name a few.
The content of the editor area depends on the current selection in the navigator area. When you select a file in the navigator area, Xcode tries to find an appropriate editor for that file type. If it can't find one, it opens the file using Quick Look (which is also used by the Finder).
Jump Bars
At the top of the editor area is the jump bar (Figure 2.14). The jump bar displays the path to the current file being edited and can be used to quickly select another file in the workspace. The jump bar also has back and forward buttons to move through a history of files edited. Each element in the path displayed in the jump bar is a pop-up menu (Figure 2.15) that you can use to navigate around your project.
The contents of the jump bar depend on the type of file you're viewing. When editing a user interface file, for example, the jump bar enables you to navigate to individual interface elements.
The Source Editor
When you select a source-code file in the navigator area, or a text/XML file, Xcode uses the source editor to open the file. This is the editor with which you will spend most of your time when you write your code. The source editor has several helpful features, such as syntax highlighting and code completion hints. You can configure individual features of the source editor using Xcode preferences.
The Assistant Editor
The assistant editor (Figure 2.16) was introduced in Xcode 4 and enables you to view multiple files side-by-side.
The assistant editor is not visible by default and can be accessed by using the editor selector buttons in the Xcode toolbar or by selecting View
The Version Editor
If your project is under version control, you can use the version editor to compare the current version of a file with a previous version. Like the assistant editor, the version editor is not visible by default and can be accessed by using the editor selector buttons in the Xcode toolbar. Version control is not covered in this book.
The Utilities Area
The utilities area (Figure 2.17) supplements the editor area. You can display it by selecting View
The Inspector Area
The top portion of the utilities area contains the inspector area (Figure 2.18). Like the navigator area, the inspector area also contains multiple tabs that can be switched using a selector bar at the top of the window.
The number of tabs available depends on the currently selected item in the project navigator. Regardless of what is selected in the project navigator, the first two tabs are always the file inspector and the quick help inspector. The file inspector provides access to the properties of the current file. The quick help inspector provides a short description of the current file.
The Library Area
The bottom portion of the utilities area contains the library area (Figure 2.19). This area contains a library of file templates, user interface objects, and code snippets that you can use in your applications.