
Swift
文章平均质量分 67
chuanyituoku
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Swift 易忽略的笔记 7):Type Casting & Nested Type
1. Type Casting Checking Type原创 2014-06-24 09:57:36 · 676 阅读 · 0 评论 -
Swift:Optional KeyNote
Optionals Use optionals to safely working with possibly missing values原创 2014-06-29 20:46:51 · 501 阅读 · 0 评论 -
Swift: Memory Management -> Weak, Unowned, Strong
Weak 和Objective-C的很像 (auto niled) Weak原创 2014-06-29 23:22:25 · 1177 阅读 · 0 评论 -
Swift 调用 Objective-C代码 1)
1. Initialization For example, where in Objective-C you would do this: SWIFT let myTableView: UITableView = UITableView(frame: CGRectZero, style: .Grouped)”原创 2014-06-25 11:04:55 · 1135 阅读 · 0 评论 -
Swift 易忽略的笔记 3): Array & Dictionary
1. Array for item in shoppingList { println(item) } // Six eggs for (index, value) in enumerate(shoppingList) { println("Item \(index + 1): \(value)") } // Item 1: Six eggs // Item 2: Milk /原创 2014-06-22 11:29:26 · 502 阅读 · 0 评论 -
Swift 易忽略的笔记 8):Extensions
1. Extensions Extensions add new functionality to an existing class, structure, or enumeration type. This includes the ability to extend types for which you do not have access to the original sou原创 2014-06-24 10:31:54 · 661 阅读 · 0 评论 -
swift 易忽略的笔记 11):Operator Functions
1. @infix struct Vector2D { var x = 0.0, y = 0.0 } @infix func + (left: Vector2D, right: Vector2D) -> Vector2D { return Vector2D(x: left.x + right.x, y: left.y + right.y) } let vector = Vec原创 2014-06-24 15:38:30 · 621 阅读 · 0 评论 -
swift 易忽略的笔记 12): Miscellaneous
1. Curried Functions and Methods Curried functions and methods have the following form: func function name(parameters)(parameters) -> return type { statements } A function declared this原创 2014-06-24 20:35:10 · 553 阅读 · 0 评论 -
Swift 易忽略的笔记 4):Function & Closure
1. func func join(string s1: String, toString s2: String, withJoiner joiner: String) -> String { return s1 + joiner + s2 }原创 2014-06-23 07:50:47 · 679 阅读 · 0 评论 -
swift 易忽略的笔记 10):Generic
1. Generic Functions func swapTwoValues(inout a: T, inout b: T) { let temporaryA = a a = b b = temporaryA }原创 2014-06-24 14:27:47 · 651 阅读 · 0 评论 -
Swift 易忽略的笔记 6):Methods & Subscripts
1。 Methods 分为instance method 和 type methods原创 2014-06-23 18:34:45 · 627 阅读 · 0 评论 -
Swift 易忽略的笔记 5):Enumeration & Classes and Structs & Properties总结
1. Enumeration let somePlanet = Planet.Earth switch somePlanet { case .Earth: println("Mostly harmless") default: println("Not a safe place for humans") } // prints "Mostly harmless”原创 2014-06-23 13:20:01 · 1042 阅读 · 0 评论 -
Swift 易忽略的笔记 9):Protocol
Protocols “A protocol defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality.” 1. Property Requirements原创 2014-06-24 11:35:32 · 1010 阅读 · 0 评论 -
Swift 易忽略的笔记 1)
1. 一条语句结尾没有分号;原创 2014-06-21 10:44:37 · 579 阅读 · 0 评论