English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Swift入门教程

 

Swift Advanced

Swift is a powerful and intuitive programming language developed by Apple. It is used to create applications for iOS, macOS, watchOS, and other platforms. Swift code is concise and expressive (easier to understand and write).-Swift combines C and Objective

The advantages of C and is not subject to the limitations of C compatibility.-Swift on the Mac OS and iOS platforms can be used with Object

2015C uses the same runtime environment.6Year8Month 2015Announced on, Apple at WWDC

Our Swift tutorial will guide you step by step to learn Swift.

Swift online compiler

About Swift programming

  • Open source - Swift source code and development builds are suitable for everyone.

  • Fast and powerful - Swift programming is fast and powerful. Similarly, the source code is concise and expressive.

  • Interoperability - Swift code can be used with existing Objective-C projects are used together.

Why learn Swift?

  • It is used to create applications for iOS, macOS, watchOS, and other platforms.

  • It is also used in providing secure and high-performance server applications.

Who is suitable for reading this tutorial?

This tutorial is suitable for programmers who want to engage in mobile (iPhone) development or OS X application development, and it is even better if they have a background in programming.

All examples in this tutorial are based on Xcode.8.2.1(Swift 3.0.2 Syntax format) Development Test.

First Swift Program

The first Swift program certainly starts with outputting "Hello, World!", the code is as follows:

/* My first Swift program */
var myStr = "Hello, World!"
 
print(myStr)
Test and see ‹/›

Example Analysis

  • var myStr = "Hello, World!" : Use the var keyword to define a variable myStr with the value Hello, World!

  • print : Output the value of the variable

How to learn Swift?

Read the Swift tutorial carefully - This is a step-by-step Swift tutorial.

Practice diligently - The only way to learn programming is to practice and write a lot of code.

Related Materials