Swift 使用来声明泛型函数或泛型类型:1 func repeat(item: ItemType,
times: Int) -> ItemType[] {2 var result = ItemType[]()3 for i in 0..times {4
result...
分类:
其他好文 时间:
2014-06-06 07:52:02
阅读次数:
299
函数 Swift 使用func关键字声明函数:1 func greet (name:
String, day: String) -> String {2 return "Hello \(name), today is \(day)."3
}4 greet ("Bob", "Tuesday"...
分类:
其他好文 时间:
2014-06-06 07:49:12
阅读次数:
340
协议 Swift 使用protocol定义协议:1 protocol
ExampleProtocol {2 var simpleDescription: String { get }3 mutating func adjust
()4 }类型、枚举和结构都可以实现(adopt)协议...
分类:
其他好文 时间:
2014-06-06 07:48:38
阅读次数:
302
Apple发布了新的编程语言Swift,也提供了一本将近400页的 The Swift
Programming Language(Swift编程语言)。Apple的东西如此之火爆,Swift一经推出大家纷纷转投iOS/OS
X怀抱,相信不久就能出现中文版的相关书籍,而各种良莠不齐的app也将蝗虫般地...
分类:
编程语言 时间:
2014-06-06 07:06:56
阅读次数:
391
protocol Container { typealias ItemType mutating
func append(item: ItemType) mutating func removelast() -> ItemType var count:
Int {get} ...
分类:
其他好文 时间:
2014-06-05 20:10:14
阅读次数:
319
http://www.jikexueyuan.com/course/92.html/?hmsr=eoe&hmmd=tonglan&hmpl=2014.06.04
分类:
移动开发 时间:
2014-06-05 20:06:56
阅读次数:
174
今天手痒想学习一下swift,要升级mac系统到10.9.3。到appstore上面检查更新,发现根本没有提示系统更新。网上查到半天才知道原来是关闭了更新推送。10.9.3更新出了很久了,我一直在等,希望能解决显卡高频不降的问题。但一直没有到接到APP推过,原来是有方法开启的,特此分享:到终端运行:...
分类:
其他好文 时间:
2014-06-05 18:56:30
阅读次数:
481
传统的认为,一个新的语言的第一个应用程序都会打印"Hellow,Word",在Swift中,可以只需要一行代码:pringln("Hello,
word")
如果你写过c或者object-c的代码,那么Swift的代码看起来会很收悉,一行代码就可以完成一个程序,你不需要另外导入输入/输出或者字符.....
分类:
其他好文 时间:
2014-06-05 17:27:47
阅读次数:
222
好久没来了,趁着新语言Swift发布,继续钻研中!Create Class 创建类
(重载效果)// Create Class 创建类class MyClass { // Properties 成员变量 init() { //
Constructor 构造函数 ...
分类:
其他好文 时间:
2014-06-05 16:44:25
阅读次数:
197
早期对ObjectiveC这玩意不是很感冒,一直没有动手搞Apple平台下的开发,现在Swift来了,时机成熟,提升门槛后的IOS,才是量子本人想弄的。现在不用担心搞ObjectiveC的走在前面了。
Swift,来的正是时候,努力学习Swift,赚钱买辆Swift开开,好了,废话少说,开干,...
分类:
其他好文 时间:
2014-06-05 16:07:39
阅读次数:
211