```cppenum Iter: Int{ case s1=0, s2, s3, s4 
mutating func next(){ if self == .s4 { self = .s1 return } ...
                            
                            
                                分类:
其他好文   时间:
2014-06-06 09:07:38   
                                阅读次数:
215
                             
                         
                    
                        
                            
                            
                                1简介今天凌晨Apple刚刚发布了Swift编程语言,本文从其发布的书籍《The Swift 
Programming Language》中摘录和提取而成。希望对各位的iOS&OSX开发有所帮助。Swift是供iOS和OS 
X应用编程的新编程语言,基于C和Objective-C,而却没有C的一些兼容约...
                            
                            
                                分类:
移动开发   时间:
2014-06-06 09:05:37   
                                阅读次数:
400
                             
                         
                    
                        
                            
                            
                                枚举 使用enum创建枚举——注意 Swift 的枚举可以关联方法: 1 enum Rank: 
Int { 2 case Ace = 1 case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten 3 
case Jack, Q...
                            
                            
                                分类:
其他好文   时间:
2014-06-06 08:30:54   
                                阅读次数:
285
                             
                         
                    
                        
                            
                            
                                Swift is a new programming language for iOS and OS 
X apps that builds on the best of C and Objective-C, without the constraints of 
C compatibility.Swi...
                            
                            
                                分类:
其他好文   时间:
2014-06-06 08:28:23   
                                阅读次数:
187
                             
                         
                    
                        
                            
                            
                                Hello, world 类似于脚本语言,下面的代码即是一个完整的 Swift 程序。1 
println ("Hello, world")变量与常量 Swift 使用var声明变量,let声明常量。1 var myVariable = 422 
myVariable = 503 let myCon.....
                            
                            
                                分类:
其他好文   时间:
2014-06-06 08:25:46   
                                阅读次数:
240
                             
                         
                    
                        
                            
                            
                                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
                             
                         
                    
                        
                            
                            
                                一提到序列化,也许你会开始迷惑了,它是什么意思呢?如果从这三个字本身,我们也许就要理解错了,序列化并不是排成序列的意思,它呢,类似于我们平时用的照相机,会将某个状态给记录下来,当我们想用的时候,就像照片一样,拿出来就行了。 
具体的定义这样的,序列化是将对象状态转换为可保持(保存)或传输的形式的过程....
                            
                            
                                分类:
其他好文   时间:
2014-06-05 20:42:43   
                                阅读次数:
243