Swift
文章平均质量分 77
肖平LaughingGor
这个作者很懒,什么都没留下…
展开
-
Swift 学习小结:简单值 及流程控制
import UIKitvar str = "Hello, playground"//简单值//let 声明常量 var 声明变量var value = 123;var i:Int = 0;var num = 0;var maVariable = 42;maVariable = 50;let myConstant = 42;let implicitInteger = 7原创 2015-03-07 13:59:59 · 612 阅读 · 0 评论 -
Swift学习小记001
今天开始正式学习Swift语言,比起Object-C来说高端多了,去年七月刚出来时只是泛泛的看了一下,直到今天才意识到,我必须要学习它,作为一个靠技术吃饭的开发者,绝不能拒绝进步。var str = "Hello, playground"var bgen:Bool = true//分支if(bgen){ println(bgen);}else{ println(bgen);}var value =原创 2015-03-06 17:53:59 · 361 阅读 · 0 评论 -
Swift学习小结之协议和扩展
import UIKitvar str = "Hello, playground"// 协议和扩展protocol ExampleProtocol { var simpleDescription:String {get} mutating func adjust()}class simpleClass: ExampleProtocol { var simple原创 2015-03-10 10:05:04 · 469 阅读 · 0 评论 -
Swift学习小结之对象和类
import UIKitvar str = "Hello, playground"//对象和类class Shape { var numberofSides = 0 func simpleDescription() ->String { return "A shape with \(numberofSides) sides" }}var shape = Shape()shape.numberofS原创 2015-03-09 10:44:30 · 560 阅读 · 0 评论 -
Swift学习小结之枚举和结构体
import UIKitvar str = "Hello, playground"//枚举和结构体enum Rank: Int{ case Ace = 1 case Two,Thress,Four,Five,Six,Seven,Eight,Nine,Ten case Jack,Queen,King func simpleDescription()->String{原创 2015-03-09 14:54:01 · 456 阅读 · 0 评论 -
Swift学习小结之泛型
import UIKitvar str = "Hello, playground"//泛型func repeat(item : ItemType, times:Int)->ItemType[]{ var result = ItemType[]() for i in 0..times{ result += item } return r原创 2015-03-10 13:42:00 · 679 阅读 · 0 评论