摘要:
// Playground - noun: a place where people can playimport UIKit// 定义和调用函数func sayHello(personName : String) -> String { let greeting = "hello, " + ... 阅读全文
posted @ 2014-11-23 18:27
2020_xx
阅读(202)
评论(0)
推荐(0)
摘要:
// Playground - noun: a place where people can playimport UIKit// For-In 循环// 1 遍历数字区间for index in 1...5 { println("\(index) times 5 is \(index)")}... 阅读全文
posted @ 2014-11-23 18:26
2020_xx
阅读(133)
评论(0)
推荐(0)
摘要:
// Playground - noun: a place where people can playimport UIKit// 数组 字典// 集合的可变性 赋值给var的集合是可变的mutable,赋值给let的集合是不可变的immutable// 数组 Array 等价于 [SomeTy... 阅读全文
posted @ 2014-11-23 18:24
2020_xx
阅读(1418)
评论(0)
推荐(0)
摘要:
// Playground - noun: a place where people can playimport UIKitvar someString = "some string literal value"someString += "another"// 初始化空字符串 2种方式,得出的结... 阅读全文
posted @ 2014-11-23 18:23
2020_xx
阅读(174)
评论(0)
推荐(0)
摘要:
// Playground - noun: a place where people can playimport UIKit// 基本运算符// 运算符有3种: 单目运算符(如 -a),二目运算符(如a+b)和三目运算符(a ? b : c)let (x, y) = (20, 30) // 分解元... 阅读全文
posted @ 2014-11-23 18:21
2020_xx
阅读(141)
评论(0)
推荐(0)
摘要:
// Playground - noun: a place where people can play// 通过代码快速了解swift常用知识,需要一定object-c基础import UIKit// 声明常量let maximumNumberOfAttemps = 10// 声明变量var cur... 阅读全文
posted @ 2014-11-23 18:19
2020_xx
阅读(245)
评论(0)
推荐(0)

浙公网安备 33010602011771号