上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 33 下一页
摘要: //: Playground - noun: a place where people can playimport UIKitvar dict = [1:"one", 2:"two", 3:"three", 4:"four"]dict.countdict.isEmptydict[1]dict[66... 阅读全文
posted @ 2015-12-16 12:37 Rinpe 阅读(207) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKit// 注意: swift中的字典用的也是中括号, 和OC的大括号是不同的// 初始化字典var dict1 = [1:"one", 2:"two", 3:"three"] ... 阅读全文
posted @ 2015-12-16 12:36 Rinpe 阅读(1260) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"var array = ["A", "B", "C", "D", "E", "F"]let arrayCount ... 阅读全文
posted @ 2015-12-16 12:36 Rinpe 阅读(156) 评论(0) 推荐(0) 编辑
摘要: import UIKit // 声明数组 var array = ["A", "B", "C", "D", "E"]; var array2:[String] = ["A", "B", "C", "D", "E"]; var array3:Array<String> = ["A", "B", "C" 阅读全文
posted @ 2015-12-16 12:35 Rinpe 阅读(1127) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKitvar str = "Welcome to Play Swift! Step by Step learn Swift language from now!"// range... 阅读全文
posted @ 2015-12-16 12:33 Rinpe 阅读(790) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport Foundationvar str = "Hello, playground"str.capitalizedString // 字符串中所有单词首字母大写, 不改变str本身的值... 阅读全文
posted @ 2015-12-16 12:32 Rinpe 阅读(208) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKit// 拼接var str = "Hello, playground"str + "hello, swift" // 这样的拼接, str还是没有改变strstr +=... 阅读全文
posted @ 2015-12-16 12:30 Rinpe 阅读(170) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKitvar str = "hi"// 字符串拼接str += ", rinpe"str += ", lili"// 创建一个空的字符串var nullStr = String(... 阅读全文
posted @ 2015-12-16 12:18 Rinpe 阅读(154) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"var a = 1, b = 10// a到b(包含a,b) [a,b]a...b// a到b-1(包含a,不包含... 阅读全文
posted @ 2015-12-16 11:43 Rinpe 阅读(208) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// nil的聚合运算可以说是为了可选值而出的 // 它的体现是"??"// eg:// a ?? b -> ... 阅读全文
posted @ 2015-12-16 11:37 Rinpe 阅读(229) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 33 下一页