9.1. Swift tutorial

发布时间 : 2025-10-25 13:33:47 UTC      

Page Views: 9 views

Image0

Swift, an open source programming language that supports multiple programming paradigms and compilation, was released by Apple in 2014 at the WWDC (Apple developer Conference) for the development of iOS,OS X and watchOS applications.

Swift combines the advantages of C and Objective-C and is not limited by C compatibility.

Swift can use the same runtime environment as Object-C on Mac OS and iOS platforms.

On June 8, 2015, Apple announced on WWDC 2015 that Swift will open source code, including compilers and standard libraries.

9.1.1. Who is suitable for this tutorial? #

This tutorial is suitable for programmers who want to work on mobile (iphone) development or OS X applications, preferably if they have a programming foundation before.

All examples of this tutorial develop tests based on Xcode8.2.1 (the syntax format of Swift 3.0.2).

9.1.2. The first Swift program #

The first Swift program, of course, outputs “Hello, World!” To begin, the code is as follows:

Example #

/*My first Swift program*/varmyString="Hello, World!"print(myString) 

Case analysis

  • var myString = "Hello, World!" use the var keyword to define a variable myString with a value of Hello, World!

  • print : The value of the output variable

9.1.3. Related materials #

  • Swift official manual

  • Swift Chinese Manual (5.0)

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。