码迷,mamicode.com
首页 >  
搜索关键字:swift swift第一个工程 swifthelloworld swift语法    ( 7059个结果
Swift-5-流程控制
// 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
Swift-9-类和结构体
// Playground - noun: a place where people can playimport UIKit// 几个重要的概念Properties/Methods/Subscripts/Initialization/Extensions/Protocols/Inheritance...
分类:编程语言   时间:2014-11-23 18:56:31    阅读次数:242
Swift-2-基本操作符
// 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
Swift-3-字符串和字符
// Playground - noun: a place where people can playimport UIKitvar someString = "some string literal value"someString += "another"// 初始化空字符串 2种方式,得出的结...
分类:编程语言   时间:2014-11-23 18:54:24    阅读次数:191
Swift-6-函数
// Playground - noun: a place where people can playimport UIKit// 定义和调用函数func sayHello(personName : String) -> String { let greeting = "hello, " + ...
分类:编程语言   时间:2014-11-23 18:53:31    阅读次数:262
Swift-1-基本概念
// 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
Swift-8-枚举
// Playground - noun: a place where people can playimport UIKit// 枚举语法enum SomeEnumeration { // enumeration definition goes here}// 定义一个枚举enum Comp...
分类:编程语言   时间:2014-11-23 18:50:48    阅读次数:197
Swift-4-数组和字典
// Playground - noun: a place where people can playimport UIKit// 数组 字典// 集合的可变性 赋值给var的集合是可变的mutable,赋值给let的集合是不可变的immutable// 数组 Array 等价于 [SomeTy.....
分类:编程语言   时间:2014-11-23 18:47:08    阅读次数:289
[Swift]Day07:柯里化
Swift 中的柯里化新手上路的学习笔记,如有错误还望指出,不胜感激。上集:理论预备在学习柯里化的过程中接触到了三个有趣的概念,在此和各位分享一下。偏函数 (Partial Function)偏函数是只对函数定义域的一个子集进行定义的函数,是一个数学概念。偏函数定义如下:从输入值集合 X 到可能的输出值集合 Y 的函数 f (记作f:X→Y) 是 X 和 Y 的关系,若 f 满足多个输入可以映射到...
分类:编程语言   时间:2014-11-23 17:35:37    阅读次数:345
完整详解GCD系列(三)-dispatch_group
完整详解GCD系列三,详细的阐述了dispatch_group的常用方法,通过实例解析如何使用。并且实例解析了dispatch_group_enter/dispatch_group_leave。提供了三个完整的实例代码...
分类:其他好文   时间:2014-11-23 13:15:13    阅读次数:150
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!