Introduction to XCode IDE
XCode is an integrated development environment designed specifically for Mac OS X. It includes a set of Apple-developed software development tools. We can create applications for iOS, watchOS, tvOS, and macOS with the help of XCode. All macOS Mojave users can get XCode 11.0, the most recent stable release, from the Mac App Store. This section of the lesson will walk you through using XCode in different settings. We will also go through a number of XCode parts.
Version History
SN | Release year | Operating system | Features |
---|---|---|---|
1.x series | 2003 | MacOS 10.3 + | It is based on the project builder. XCode 1.5 has an improved debugger and better code compiler. |
2.X series | 2005 | MacOS 10.4 + | It included the Quartz Composer, better code sense indexing for Java, and Ant support. The XCode 2.1 could create pre-compiled binary files. |
3.X series | 2007 | macOS 10.5+ | The XCode 3.X series includes DTrace debugging tool(instruments), refactoring support, context-sensitive documentation, and Objective C 2.0 with garbage collection. |
4.X series | 2011 | macOS 10.6.8+ | XCode version 4 integrated the XCode editing tool and interface builder into one application. Among many changes, it also included the support for iOS iOS 5.1, enhancements to iOS simulator, and suggested the move to LLDB debugger versus the GDB Debugger. |
5.X series | 2013 | macOS 10.8+ | It added support for iOS 7 SDK. It also added a version of Clang generating 64-bit ARM code for iOS 7. Apple removed support for building garbage collected Cocoa binaries in XCode 5.1 |
6.x series | 2014 | macOS 10.9.4+ | XCode version 6 provided many enhancements, including the support for all new programming language of apple i.e., Swift. XCode 6 also includes the support for playgrounds and live debugging tools. |
7.x series | 2015 | macOS 10.10.3+ | XCode version 7 provided support for Swift 2 and metal for OS X. It also added the support for deploying an iOS device without having an apple developer license. |
8.x series | 2016 | macOS 10.11.5+ | XCode version 8 provided support for Swift 3. |
9.x series | 2017 | macOS 10.12.6+ | It provided support for Swift 4 and metal 2 for OS X. |
10.x series | 2018 | macOS 10.13.6+ | Xcode 10 introduced support for the Dark Mode announced for macOS Mojave, the collaboration platforms Bitbucket and GitLab (in addition to GitHub), training machine learning models from playgrounds, and the new features in Swift 4.2 and Metal 2.1, as well as improvements to the editor and the project build system. |
11.X series | 2019 | macOS 10.14.4+ | XCode 11 introduced support for the new features in Swift 5.1, as well as the new SwiftUI framework (although the interactive UI tools are only available when running under macOS 10.15). It also supports building iPad applications that run under macOS; includes integrated support for the Swift Package Manager; and contains further improvements to the editor, including a “minimap” that gives an overview of a source code file with quick navigation. |
Installing XCode Version 11, the most recent version, from the Apple Mac App store is possible on macOS Mojave. However, we will be using XCode 10.2.1 in this lesson.
A Quick walkover of XCode
Let’s take a quick look at XCode 10.2.1 to get a sense of how development in the program will work.
The target information of the XCode Project is displayed in the window that appears when we create a new one. It displays all of the project’s information, including the application start icons, bundle identifier, build version, signing information, deployment information, linked binaries, and framework information.
A project information pane that displays all the project data seen in the accompanying image is located above the goal information. It includes details about the iOS version that the program was made for. Information on the release is also included.
Later in this lesson, we will go into more depth about the project and the desired information.
Let’s now take a closer look at each element of an XCode window (see figure below).
Standard Editor
In the center of the window is the usual editor. It is the project’s default editor, as the name implies, where project files are edited. It includes the first View Controller class file with the lifecycle method built in it, as well as information about the file that is commented at the beginning. The lifecycle methods will be covered in the tutorial’s following sections. The project file’s hierarchical information is displayed in the Standard editor’s top pane. Other files can be opened in the same editor with it as well. On the other hand, the project browser also allows us to access additional project files.
Assistant Editor
The primary purpose of the Assistant Editor is to generate outlets for the storyboard elements (Textfield, Label, etc.) in the associated View Controller class file. On the other hand, we can view two files in the editor at once thanks to the Assistant editor.
Project Navigator
On the left side of the window is the project navigator. It displays the project’s file structure. It is employed for project navigation. The files displayed in the following image are the first files in an XCode project.
File Inspector
As seen in the image below, the inspectors are located to the right of the XCode window. The associated swift file that is open in the default editor is fully detailed in the file inspector. It includes information on the Name, Type, Location, and interface builder document.
Quick help inspector
It is utilized to give the user assistance by allowing them to search the syntax documentation. It appears as the picture below.
Identity Inspector
Identity Inspector is primarily utilized when interacting with storyboards. It displays details about the Swift class files that correspond to the storyboard’s View Controller components. We must allocate class files to the storyboard components in order to program them appropriately. Identity Inspector displays all of this data, as seen in the image below. It asks the developer to designate the relevant storyboard View Controller’s class and module. In addition, it asks the developer to give the View Controller the identity name, which will be used to identify it for the duration of the project. The UIView displayed in the storyboard can also have certain runtime constraints applied to it.
Attribute Inspector
To assign various characteristics, including as background color, font color, font size, interactivity, tags, and content mode, to the associated UIView in the storyboard, utilize an attribute inspector. Using the attribute inspector, the storyboard views’ static attributes can be runtime modified programmatically.
Size Inspector
When creating using a storyboard, the size limits applied to the view are disclosed via the size inspector. With the Size Inspector, we may change the size restriction applied to the view.
Connections Inspector
It displays details regarding the relationships between the swift class file and the appropriate storyboard UIView. It includes all of the links between the swift class files and the storyboard.
Media Library
It is mostly used to construct iOS applications, such as collection view. Drag and drop capability in the media library allows us to add the desired widget to the storyboard. We can use the shortcut key command + shift + L to open the media library.
The debugger console, used for program runtime debugging, is displayed at the bottom of the Standard Editor. Additionally, the print() and debugPrint() functions are used in swift to print the values to the console.