// Playground - noun: a place where people can playimport UIKit// For-In 循环// 1 遍历数字区间for index in 1...5 { println("\(index) times 5 is \(index)")}...
分类:
编程语言 时间:
2014-11-23 18:57:25
阅读次数:
195
// Playground - noun: a place where people can playimport UIKit// swift 中闭包与C和OC中的blocks比较相似// 1. 利用上下文推断参数和返回值类型 2. 单表达式闭包可以省略return关键字 3. 参数名称简写 4. ...
分类:
编程语言 时间:
2014-11-23 18:57:07
阅读次数:
162
// Playground - noun: a place where people can playimport UIKit// 几个重要的概念Properties/Methods/Subscripts/Initialization/Extensions/Protocols/Inheritance...
分类:
编程语言 时间:
2014-11-23 18:56:31
阅读次数:
242
// Playground - noun: a place where people can playimport UIKit// 基本运算符// 运算符有3种: 单目运算符(如 -a),二目运算符(如a+b)和三目运算符(a ? b : c)let (x, y) = (20, 30) // 分解元...
分类:
编程语言 时间:
2014-11-23 18:54:52
阅读次数:
220
// Playground - noun: a place where people can playimport UIKit// 定义和调用函数func sayHello(personName : String) -> String { let greeting = "hello, " + ...
分类:
编程语言 时间:
2014-11-23 18:53:31
阅读次数:
262
// Playground - noun: a place where people can play// 通过代码快速了解swift常用知识,需要一定object-c基础import UIKit// 声明常量let maximumNumberOfAttemps = 10// 声明变量var cur...
分类:
编程语言 时间:
2014-11-23 18:53:09
阅读次数:
214
// Playground - noun: a place where people can playimport UIKit// 枚举语法enum SomeEnumeration { // enumeration definition goes here}// 定义一个枚举enum Comp...
分类:
编程语言 时间:
2014-11-23 18:50:48
阅读次数:
197
// Playground - noun: a place where people can playimport UIKit// 数组 字典// 集合的可变性 赋值给var的集合是可变的mutable,赋值给let的集合是不可变的immutable// 数组 Array 等价于 [SomeTy.....
分类:
编程语言 时间:
2014-11-23 18:47:08
阅读次数:
289
本文转载至http://www.cocoachina.com/ios/20141104/10124.htmlMetaliOS开发Sprite Kit图形编程iOS实现图形编程可以使用三种API(UIKIT、Core Graphics、OpenGL ES及GLKit)。这些api包含的绘制操作都在一个...
分类:
移动开发 时间:
2014-11-23 00:41:55
阅读次数:
358
Cocoa与Cocoa Touch 区别之分是要介绍的内容,他们共同点就是二者都包含Objective-C运行时和两个核心框架:
Cocoa包含Foundation和ApppKit框架,可用于开发Mac OS X系统的应用程序;
Cocoa Touch包含Foundation和UIKit框架,可用于开发iPhone OS的开发环境
...
分类:
其他好文 时间:
2014-11-22 16:07:06
阅读次数:
191