// Playground - noun: a place where people can playimport UIKit//=================================================================//函数//// func 函数名...
分类:
编程语言 时间:
2015-02-05 00:36:13
阅读次数:
235
1 // Playground - noun: a place where people can play 2 3 import UIKit 4 5 var str = "Hello, World!" 6 7 //1 定义变量常量/常量 8 // define const ...
分类:
编程语言 时间:
2015-02-05 00:34:52
阅读次数:
282
本篇内容是在XCode的Playground下编写的那么什么是Playground呢?提到Playground我们就不得不提Swift这个最近苹果公司力推的语言,Swift是苹果公司在WWDC2014上发布的全新开发语言。从演示视频及随后在appstore上线的标准文档看来,语法内容混合了OC,JS...
分类:
编程语言 时间:
2015-02-03 19:13:04
阅读次数:
138
创建一个playGround,然后看一下代码,跟着打,别复制粘贴。 1 // Playground - noun: a place where people can play 2 3 import UIKit 4 5 // HelloWorld 6 var str = "Hello,...
分类:
编程语言 时间:
2015-02-03 14:49:53
阅读次数:
191
// Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"//------------------------- 类和结构体的相同与不同 ------------------...
分类:
编程语言 时间:
2015-01-26 01:18:10
阅读次数:
291
// Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"print("A"); print("A") // 如果同一行有有段代码用 ';'隔开// 默认自带换行符print...
分类:
编程语言 时间:
2015-01-26 01:11:52
阅读次数:
197
由于使用 Cocoa 框架能够快速地创建一个可用的应用,这让许多开发者都喜欢上了 OS X 或 iOS 开发。如今即使是小团队也能设计和开发复杂的应用,这很大程度上要归功于这些平台所提供的工具和框架。Swift 的 Playground 不仅继承了快速开发的传统,并且有改变我们设计和编写 OS X ...
分类:
其他好文 时间:
2015-01-12 00:20:32
阅读次数:
344
我们知道classes是引用类型,structs属于值类型。这就意味着,当你传递一个class,Swift传递的是对象的引用,而当你传递一个struct,Swift传递的是对象的值。
在playground写下如下代码,看看它的输出及其效果。
Structs vs classes
上面分别定义了一个结构体一个类,它们都只有一个变量。代码分别生成一个struct和c...
分类:
其他好文 时间:
2015-01-06 23:09:11
阅读次数:
223
1 // Playground - noun: a place where people can play 2 3 import UIKit 4 //---------------------------------------------------------------------...
分类:
编程语言 时间:
2015-01-01 12:29:09
阅读次数:
148
// Playground - noun: a place where people can playimport UIKit/***********************************************************//*** 一. A Swift Tour*///1....
分类:
编程语言 时间:
2014-12-30 00:25:32
阅读次数:
231