码迷,mamicode.com
首页 >  
搜索关键字:ios-swift    ( 298个结果
Swift编程语言学习——数值型字面量、数值类型转换
数值型字面量 整数字面量可以被写作: 一个十进制数,没有前缀 一个二进制数,前缀是0b 一个八进制数,前缀是0o 一个十六进制数,前缀是0x 下面的所有整数字面量的十进制值都是17: let decimalInteger = 17 let binaryInteger = 0b10001       // 二进制的17 let octalInteger = 0o21...
分类:编程语言   时间:2014-07-08 18:28:32    阅读次数:176
Swift编程语言学习——类型安全和类型推测
Swift 是一种类型安全(type safe )的语言。类型安全的语言可以让你清楚地知道代码要处理的值的类型。如果你的代码需要一个String,你绝对不可能不小心传进去一个Int。 由于 Swift 是类型安全的,所以它会在编译你的代码时进行类型检查(type checks),并把不匹配的类型标记为错误。这可以让你在开发的时候尽早发现并修复错误。 当你要处理不同类型的值时,类型检查可以帮你避...
分类:编程语言   时间:2014-07-08 15:57:07    阅读次数:202
iOS- Swift实现UITableView的常见操作
1.前言 Swift在这就不多介绍了,想必大家都已皆知。离Swift面世也过了有一个多月的时间。在闲暇时间我用Swift实现了UITableView的一些常见操作。基本都是可以用上的,今天在自己的博客里分享给大家。2.初始化程序入口 初始化程序入口,先给我们的ViewController封装一个.....
分类:移动开发   时间:2014-07-07 12:54:07    阅读次数:192
Swift-Lesson2(下)
...
分类:其他好文   时间:2014-07-03 15:42:33    阅读次数:177
Swift构造器(Initializer)与析构器(Deinitializer)
为了初始化结构体和类等类型的实例属性。默认构造器  struct Fahrenheit {var temperature: Doubleinit(){temperature = 32.0} } var f = Fahrenheit() //调用默认构造器 init() ,没有参数 没有返回值。println("The default temperature   is \(f.temperature...
分类:其他好文   时间:2014-07-02 08:42:57    阅读次数:304
Swift扩展(Extension)
在现有类和结构体的类型基础上,扩展新的功能。 语法:extension SomeType{// new functionality to add to SomeType goes here}An extension can extend an existing type to make itadopt one or more protocols.Where this is the case,the...
分类:其他好文   时间:2014-07-02 07:36:22    阅读次数:244
Swift - Lesson2(上)
...
分类:其他好文   时间:2014-07-02 07:07:43    阅读次数:156
ios8 swift开发:let var 区别讨论
localhost:~ hejiasheng$ xcrun swift Welcome to Swift! Type :help for assistance. 1> var a:Int a: Int = 0 2> let b:Int :2:5: error: 'let' declarations require an initializer expression let b:Int ...
分类:移动开发   时间:2014-07-01 14:23:25    阅读次数:443
ios8 swift开发:显示变量的类名称
var ivar = [:] ivar.className // __NSDictionaryI var i = 1 i.className // error: 'Int' does not have a member named 'className' If you want to get the type of a primitive, you have to use brid...
分类:移动开发   时间:2014-07-01 06:31:12    阅读次数:234
ios swift reduce Method
Swift’s API includes many functions and instance methods that reflect its functional programming heritage. A prime example is calledreduce.You can red...
分类:移动开发   时间:2014-07-01 00:27:22    阅读次数:329
298条   上一页 1 ... 24 25 26 27 28 ... 30 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!