// 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
swift 优势:1、简洁(不是说语法体系简洁,而是书写)2、结合playground,做到真正意义上的所见即所得3、便于扩展(能桥接ObjC)4、还有直接支持闭包。你想在哪儿定义函数就在哪儿定义。5、而且既能面向过程,又能面向对象,还能来个函数式编程风格当然,因为之前的项目费代码一大堆。我接手这个...
分类:
编程语言 时间:
2014-11-04 12:34:51
阅读次数:
191
// Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// swift的集合类型只有数组和字典// 数组中只能存储相同类型的数据(可以是基本类型,也可以是类对象)// 申...
分类:
编程语言 时间:
2014-11-01 09:46:11
阅读次数:
217
// Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// color与=号之间必须有个空格let colors =[ "Air Force Blue":(red:...
分类:
编程语言 时间:
2014-11-01 09:43:28
阅读次数:
206
// Playground - noun: a place where people can playimport UIKit//import Foundationvar str = "Hello, playground"//swift 新运算符 Nil Coalescing Operator (....
分类:
编程语言 时间:
2014-10-31 15:34:18
阅读次数:
122
直接上代码:// Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// 使用if ,switch 来进行条件操作 ,for-in , for ,while ,do-whi...
分类:
编程语言 时间:
2014-10-28 23:57:06
阅读次数:
346
【适合对象】有一定编程基础的同学【情景】边看边练,多练多学,自然成长。【声明】此文章属于原创作品,未经授权,如非法转载,予以追究法律责任。练习笔记:1.var变量var str = "Hello, playground"println(str) 2.if语句var a = 20if a > 10 ....
分类:
编程语言 时间:
2014-10-21 21:23:41
阅读次数:
358
// Playground - noun: a place where people can play
import UIKit
//------------------------------------------------------------------------------
// 1. 基本使用
// switch 与OC的区别:
// 1> 不需要写break
// 2> 每...
分类:
编程语言 时间:
2014-10-21 15:26:06
阅读次数:
220
// Playground - noun: a place where people can play
import UIKit
//------------------------------------------------------------------------------
// 1. for
// 传统的for循环方式在swift中同样支持
var num = 0
for(v...
分类:
编程语言 时间:
2014-10-20 15:14:51
阅读次数:
221