The beginning IOS8 programming with Swift Chinese translation-7

Source: Internet
Author: User

Weekend two days without updates, continue today!

1 build Your First app to create your one app

"The the-to-get started is to quit talking and begin doing." Start is to give up talking and start down to earth!

–walt Disney-Walt Disney (founder of Disney)

Hello world! Build Your first app using Swift Hello, world! Create your app with Swift

By now you should has installed Xcode 6 and some understandings of Swift language. If you haven ' t do so, check out the previous chapter on what's need to begin IOS programming. We'll use the Xcode 6.1 (or up) and the all exercises

Now you should have installed Xcode6 and have a certain understanding of the swift language. If you haven't done so, review the previous section on what you need to do to start iOS development. In this book, we will use Xcode6.1 or above to do all the exercises.

You are heard of "Hello world" and if you have a read any programming book before. Hello World was a program for First-time programmer to create. It's a very simple program, this outputs "Hello, World" on the screen of a device.

If you have read some books about development before, then you should know that many of them are beginning with "Hello Worod". Hello World is a program for programming beginners to create, and that is a very simple just output a "Hello" on the device's screen.

It ' s a tradition in the programming world. So, let's follow the programming tradition and create a "Hello World" app using Xcode. Despite its simplicity, the ' Hello World ' program serves a few purposes:

It's a tradition in the world of programs. So let's follow the tradition of the program and create a "Hello World" app in Xcode. Although he is very, very simple foundation, but "Hello world" also for these several purposes exist.

      • It gives overview about the syntax and structure of Swift, the new programming language of IOS.       He will give you a general idea of the grammar and structure of Swfit, a new programming language for iOS.

      • It also gives you a basic introduction to the Xcode 6        He can also give you an introduction to the XCODE6 environment. Basic introduction)
        environment. You'll learn how to create a Xcode project and   you'll learn how to go about creating a Xcode item
        lay out your user interface using Storyboard. Even if you ' ve     How to customize your user interface using storyboard.
        used Xcode 5 before, you'll learn what's new in the latest version of Xcode.   Even if you've used XCODE5 before, you can learn what the latest version of Xcode is Updated.

      • You'll learn how to compile a programs, build the app and test it using the Simulator.     You'll learn to compile a program that creates An app and how to test it with the emulator.

      • Lastly, it makes you think programming are not difficult. I don ' t want to scare you away   Finally, it will make you realize that programming is not so difficult. I don't want to scare you away from the way you learn to program.

        From learning programming. It ' ll be fun.   He is full of fun.

Your First app your app Your first app, as Displa Yed in Figure 1-1, was very simple and just shows a "Hello World" button. When user taps the button, the app shows a welcome message. That ' s it. Extremely simple and it helps you kick off your IOS programming journey.

Your first app, like the number 1-1, is very simple, just to show a "Hello World" button. When the user clicks this button, the app will display a welcome message, just so. Extremely simple, but it will help you to start your iOS programming journey.

It's normal If you don't understand the source code. Just relax and focus on building your first app. Familiarize yourself with the Xcode environment and Storyboard. I'll explain the language as we go along and you'll learn how the HelloWorld app works in the next chapter.

If you do not understand the principle of the code is very normal. You just have to relax and focus on creating your first app. To familiarize yourself with the Xcode environment and storyboard, I will explain the language in the course of our progress and in the next section you will learn how to make Hello World work.

Let's jump right into create a project lets go and create a program

First, launch Xcode. If you've installed Xcode via Mac App Store, you should is able to locate Xcode in the LaunchPad. Just Click on the Xcode icon to start it up.

Once launched, Xcode displays a welcome dialog. From here, choose "Create a new Xcode project" to start a new project:

The first step is to run Xcode. If you have previously installed Xcode in the Mac Apple Store, you should be able to find Xcode in Launchpad, and you just need to click the Xcode icon to launch it.

First run, Xcode will show a welcome interface. From here, select "Create a new Xcode project" To start the program:

Xcode shows various project template for selection. For the your first app, choose "Single View Application" and click "Next".

Xcode displays a variety of project templates for you to choose from, for your first app, select "Single View Application" and click "Next"

This brings is the next screen to fill with the necessary options for your project.

This will jump to an interface that you must set in your project.

You can simply fill in the options as follows: Follow the introduction below to simply fill in the settings
Product Name:helloworld–this is the name of the your app.organization name:appcoda–it ' s the name of your Organization.

Project Name: helloworld-This is the name of your app organization name: appcoda-This is the name of your company (organization)

Organization Identifier:com.appcoda–it ' s actually the domain name written the Otherway round. If you had a domain, you can use your own domain name. Otherwise, youmay use "Com.appcoda" or just fill in "edu.self".

Identifier of the organization: com.appcoda-This is actually the domain name of your organization that is written in turn. If you have a domain, you can use your domain name, if not, you can write Com.appcoda to fill in

Bundle identifier:com.appcoda.helloworld-it ' s a unique Identifier of your app which isused during app submission. You don't need to fill the this option. Xcode automaticallygenerates it for you.

Binding identifier: Com.appcoda.helloworld-This is a unique identifier used when your app is submitted. You don't have to fill it out manually. Xcode will ask you to generate it automatically.

Language:swift–xcode 6 supports both Objective-c and Swift for app development. Asthis book was about Swift, we'll use Swift to develop the project.

Language: Swift:swfit-xcode6 supports objective-c and Swift in the development of apps. This book is about Swift, and we will use Swift to develop the project.

Devices:iphone–select "IPhone" for this project.

Equipment: iphone-This project select "IPhone"

Use Core Data: [Unchecked]–do not select this option. You don't need Core Data for this simple project. We ' ll explain Core Data in later chapters.

Use core data: Do not select this option. This simple project does not require the use of core data. We will explain him in a later chapter.

Click "Next" to continue. Xcode then asks your where to save the "HelloWorld" project. Pick any folder (e.g. Desktop) on your
Mac. You could notice there is a option for source control. Just deselect it. We don't need to use the option in this book . Click "Create" to continue.

Click "Next" to continue. Xcode asks you where to save your "Hello World" project. Choose any location on your Mac computer to store it. You may have some questions about versioning, you just don't choose him, we won't use this option in this book, click "Create" to continue.

As you confirm, Xcode automatically creates the ' Hello World ' project. The screen willlook like the screenshot shown in Figure 1-6. You can ignore the "No matching signingidentity found" error.

With your confirmation, Xcode automatically creates a "Hello world" project, and you may see a screen like the one on the screen. You can ignore the "No matching signing indentity found" error.

The beginning IOS8 programming with Swift Chinese translation-7

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.