该文被密码保护。 阅读全文
posted @ 2015-07-03 23:27 殇卜泣 阅读(2) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2015-07-03 23:21 殇卜泣 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 泛型在尖括号里写一个名字来创建一个泛型函数或者类型。func repeat(item: ItemType, times: Int) -> [ItemType] { var result = [ItemType]() for i in 0.. { case None case Some(T)}... 阅读全文
posted @ 2015-06-24 22:26 殇卜泣 阅读(199) 评论(0) 推荐(0) 编辑
摘要: //: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"var a = 5switch a { case 4: println("yes") default: p... 阅读全文
posted @ 2015-06-17 23:20 殇卜泣 阅读(189) 评论(0) 推荐(0) 编辑
摘要: static int P = 11;static int Q = 13;static int N;static int M;static int E;static int D;- (instancetype)init{ self = [super init]; if (self) { N ... 阅读全文
posted @ 2015-06-09 23:52 殇卜泣 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1. 可以把函数赋给临时变量,可利用变量来调用函数,也可以改变,使该变量随其他函数进行引用(也可以赋值给常量)。2. 函数可作为参数传递给另一个函数 更改第一个函数的实现 ,第二个就会跟着一起改变。3.函数可作为另一个函数的返回值。4. 嵌套函数 把一些函数放到另一个函数内部,外部访问不到这些函数。... 阅读全文
posted @ 2015-06-06 21:43 殇卜泣 阅读(114) 评论(0) 推荐(0) 编辑
摘要: // inherit & extension 继承和扩展//父类class 车 { var 速度 = 0 var 描述 :String { return "时速\(速度)公里每小时" } func 声响() { }}let 一辆车 = 车()一辆车.描述//子类继承父类clas... 阅读全文
posted @ 2015-05-21 20:43 殇卜泣 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 个人觉得对于已经有过oc开发经验的人来说,学习swift最快的就是学好基础!基础学好,学扎实了,到后面基本就感觉很容易了。 import Foundation//1.数组的基本认识var 数组1 = [1,2,3,4,5,6,7]数组1[0] = 3数组1//求指定半径的圆的面积 S = pi... 阅读全文
posted @ 2015-05-17 11:27 殇卜泣 阅读(133) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2015-05-15 20:59 殇卜泣 阅读(3) 评论(0) 推荐(0) 编辑