摘要: http://avalonjs.coding.me/ 有时间详细写 阅读全文
posted @ 2016-12-26 16:03 浪味小仙女 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 枚举 enum CompassPoint { case north case south case east case west } var directionToHead = CompassPoint.west directionToHead = .east 递归枚举indirect indire 阅读全文
posted @ 2016-12-06 16:05 浪味小仙女 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1.sorted方法举例闭包的方法 不用闭包传入方法(String, String) -> Bool.需要有这一样一个方法 let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"] func backward(_ s1: String, _ 阅读全文
posted @ 2016-12-05 16:34 浪味小仙女 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1.函数的基本形式 func greetAgain(person: String) -> String { return "Hello again, " + person + "!" } print(greetAgain(person: "Anna")) 2.用元组作为返回值 func minMax 阅读全文
posted @ 2016-12-01 17:08 浪味小仙女 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 元组(tuples) 把多个值组合成一个复合值。元组内的值可以是任意类型,并不要求是相同类型 let http404Error = (404, "Not Found") let (statusCode, statusMessage) = http404Error print("The status 阅读全文
posted @ 2016-12-01 14:49 浪味小仙女 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1.For-in循环中... for index in 1...5 { print("\(index) times 5 is \(index * 5)") } for _ in 1...5 { 可以用下划线忽略当前值 } 2.字典通过元祖返回 3.do while循环变成repeat repeat 阅读全文
posted @ 2016-11-30 16:36 浪味小仙女 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 数组 1.创建一个数组 var someInts = [Int]()空数组 someInts = []清空 var threeDoubles = Array(repeating: 0.0, count: 3)有默认值的数组 var shoppingList: [String] = ["Eggs", 阅读全文
posted @ 2016-11-29 16:24 浪味小仙女 阅读(486) 评论(0) 推荐(0) 编辑
摘要: 常量 变量 let age = 20 常量不可变 var num = 24 变量可变 let count:Int = 2 定义类型 Double(count) 类型转换 符号 1.?? let def = "red" var user : String? user = "hh" user ?? de 阅读全文
posted @ 2016-11-29 15:56 浪味小仙女 阅读(619) 评论(0) 推荐(0) 编辑
摘要: 注意 1.焦点图初始化ID和图片最外层ID保持一致 2.图片列表外面必须包裹一个div,且id必须为pic http://demo.jb51.net/js/myfocus/tutorials.html http://demo.jb51.net/js/myfocus/api.html <script 阅读全文
posted @ 2016-11-22 15:43 浪味小仙女 阅读(220) 评论(1) 推荐(0) 编辑
摘要: <canvas id="gameView" width="400px" height="400px" style="background-color: antiquewhite"></canvas> 1.Stage舞台 var stage = new createjs.Stage("gameView 阅读全文
posted @ 2016-11-04 16:55 浪味小仙女 阅读(220) 评论(0) 推荐(0) 编辑