The beginning IOS8 programming with Swift Chinese translation-8

Source: Internet
Author: User

Some time ago back home (grandmother Died) so, a few days not updated ... Then continue.!

Familiarize yourself with Xcode Workspace familiarize yourself with the work space of Xcode

Before we move on to the coding part, let's take a few minutes to having a quick look at the Xcode workspace environment. The pane is the Project navigator. You can find all your project files in the this area. The center part of the workspace are the editor area. The editing stuff here (such as editing the project setting, source code file, user interface, etc) in this is A. Depending on the type of file, Xcode shows you different interfaces in the editor area. For instance, if you select Viewcontroller.swift in the Project Navigator, Xcode displays the source code in the center AR EA (see Figure 1-7). If you select the "Main.storyboard", which are the file for storing user interface, Xcode shows your visual editor for S Toryboard (see Figure 1-8).

Before we focus on the coding section. Let's take a few minutes to get a quick tour of the Xcode work environment. In the left area of the project navigation bar, you can find all the project files. The middle part of the workspace is the coding area. You can do all the editing related things in this area (such as editing project settings,  Resource files, interface builds, and so on), Xcode will show you different interfaces in the editing area, thanks to the different types of files. For example, if you selected Viewcontroller.swift,xcode in the project navigation bar, it shows 1 in the middle area. If you choose Main.stroyboard, yes, that's the user interface's storage file, Xcode will show you 2 of the interface editing tools called Stroyboard.

The rightmost pane is the utility area. This area displays the properties of the file and allows your to access Quick help. If Xcode doesn ' t show this area, you can select the rightmost button in the toolbar to enable it.

The rightmost pane is the tool area, which shows the contents of the file and allows you to use quick help. If Xcode doesn't have a realistic area, you can choose the rightmost button on the toolbar to make it available.

The middle View button of the view selector is deselected by default. If you click on it, Xcode displays the "Debug area right below" the editor area. The debug area, as its name suggests, was used for showing debug messages. We'll talk about this in a later chapter. So, don ' t worry if you don't understand what's each of the area are for.

In the middle of the interface, the interface method is turned off by default. If you click on him, Xcode will be in the lower right corner of the area of the realistic debugging area. Just like the name suggests, the debug area is used to display debug information. We will explain in later chapters, so if you don't understand what each area does, don't worry too much.

Run Your app for the first time running your app

Until Now, we have written zero lines of code. Even so, you can run your app using the built-in Simulator. This would give you a idea how to buildand test your app in Xcode. in thetoolbar, you should see the Runbutton. If you hit the Run button, Xcodeautomatically builds the app and runs it inThe selected Simulator. By default, the Simulator are set to IPhone 6. You can click on the IPhone 6 button and you'll see a list of available simulators. As we ' re going to build a iphone app, you can use iphone 6 (or other iphone models) as the Simulator. For this demo, I choose IPhone 5s. Once selected, you can click the Run button to the load your appIn the Simulator. Figure 1-11 shows the simulator for an IPhone 5s.

Until now, we have not written a single line of code. Even so, you can use the built-in simulator to run your app, which will give you an idea of how to run and test your app in Xcode. In the toolbar, you can see the Run button, if you click on this button, Xcode will automatically compile your app and run it on the selected emulator. By default, the emulator is set to IPhone6, you can click the IPhone6 button, and you can see a list of available emulators. When we're creating an iphone app, You can use IPhone6 (or other simulator) as the simulator, this demo, I choose IPhone5S, once selected, you can click the Run button to make your app load in the simulator, will show the IPhone5S simulator.

A White and nothing inside?! That ' s normal. As we haven ' t implemented the user interface or written any lines of code, the Simulator shows a blank screen. To terminate the app, simply hits the "Stop" button in the toolbar.

Try to select another simulator and run the app. Just play around with it so you'll get used to the Xcode development environment.

A blank screen without any information? This is normal. When we do not implement user interface or do not write any line of code, the simulator will live a blank screen. If you want to end the app, simply click the "Stop" button on the toolbar. Try to choose another simulator to run the app, Play with him, because you have to familiarize yourself with the Xcode development environment.

Designing user Interface using Storyboard with Stroyboard setting UI

Now it has a basic idea of the Xcode development environment. Let's move on and design the user interface of your first app. In the Project Navigator, select the "Main.storyboard" file. Xcode then brings-a visual editor for storyboards known as Interface Builder.

Now you have a basic understanding of the Xcode development environment. Let's start by setting up a user interface for your first app. In the navigation bar of the project. Select the "Main.stroyboard" file, and Xcode will present a Stroyboard user Interface Editor.

The beginning IOS8 programming with Swift Chinese translation-8

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.