7.17

2016-07-17  本文已影响0人  zhujian6

创建一个ios应用->Single View Application->填写项目名称和选择语言

let redView = UIView()

redView.frame = CGRectMake(100, 100, 100, 100)

redView.backgroundColor = UIColor.redColor()

Self.View.addSubview(redView)

super.viewDidLoad() //内容添加在之后

快捷键

Shfit+Command+h

Shift+Command+h+h

Shift+方向键

Command+[

Command+]

if else条件判断语句

switch-case分支语句(语句为空时使用break,使用fallthrough才能执行下一个case)

while循环语句

for循环语句

enum{} 枚举

repeat while 至少重复一次

for循环-遍历数组【for i in 数组名】

for循环-遍历字典【for pair in dict】

              【for (key, value) in dict】

使用_ 下划线占位

上一篇 下一篇

猜你喜欢

热点阅读