1.Swift的源文件拓展名.swift
2.两个不需要:①不需要编写main函数②不需要再每一条语句后面加上分号
3.多行注释可以嵌套
4.let声明常量 var声明变量
let radius = 10
var x= 0,y = 0,z = 0
5.UIImageView
var imageView = UIImageView()
imageView.image = UIImage(name:"002.png")
imageView.frame = CGRectMake(20,20,100,50)
self.view.addSubview(imageView)
6.Playground
7.字符串
①:一般形式
let web = "xxxxxxx"
②:拼接 加 +
let str = "123"
let str2 = "456"
let dest = str + str2
③:插值
let hand = 2
var age = 20
let str = "我今年(age)岁了,有(hand)只手"
④:类型转换
var age = 10
转换成字符串:<1>var str = String(age) <2>var str2 = "(age)"
8:打印输出函数
println:输出内容会自动换行
print:少了自动换行功能
代码示例:①println("Learn Swift")②let name = "Learn Swift + Learn X "; print(name)
9:常量和变量的命名
任意.....(control + command + 空格----- 弹出emoji键盘)
注意: