Swift
文章平均质量分 67
chuanyituoku
这个作者很懒,什么都没留下…
展开
-
Swift 易忽略的笔记 7):Type Casting & Nested Type
1. Type CastingChecking Type原创 2014-06-24 09:57:36 · 655 阅读 · 0 评论 -
Swift:Optional KeyNote
OptionalsUse optionals to safely working with possibly missing values原创 2014-06-29 20:46:51 · 470 阅读 · 0 评论 -
Swift: Memory Management -> Weak, Unowned, Strong
Weak 和Objective-C的很像 (auto niled)Weak原创 2014-06-29 23:22:25 · 1146 阅读 · 0 评论 -
Swift 调用 Objective-C代码 1)
1. InitializationFor example, where in Objective-C you would do this:SWIFTlet myTableView: UITableView = UITableView(frame: CGRectZero, style: .Grouped)”原创 2014-06-25 11:04:55 · 1105 阅读 · 0 评论 -
Swift 易忽略的笔记 3): Array & Dictionary
1. Arrayfor item in shoppingList { println(item)}// Six eggsfor (index, value) in enumerate(shoppingList) { println("Item \(index + 1): \(value)")}// Item 1: Six eggs// Item 2: Milk/原创 2014-06-22 11:29:26 · 486 阅读 · 0 评论 -
Swift 易忽略的笔记 8):Extensions
1. ExtensionsExtensions 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 · 632 阅读 · 0 评论 -
swift 易忽略的笔记 11):Operator Functions
1. @infixstruct 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 · 603 阅读 · 0 评论 -
swift 易忽略的笔记 12): Miscellaneous
1. Curried Functions and MethodsCurried 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 · 531 阅读 · 0 评论 -
Swift 易忽略的笔记 4):Function & Closure
1. funcfunc join(string s1: String, toString s2: String, withJoiner joiner: String) -> String { return s1 + joiner + s2}原创 2014-06-23 07:50:47 · 654 阅读 · 0 评论 -
swift 易忽略的笔记 10):Generic
1. Generic Functionsfunc swapTwoValues(inout a: T, inout b: T) { let temporaryA = a a = b b = temporaryA}原创 2014-06-24 14:27:47 · 628 阅读 · 0 评论 -
Swift 易忽略的笔记 6):Methods & Subscripts
1。 Methods分为instance method 和 type methods原创 2014-06-23 18:34:45 · 606 阅读 · 0 评论 -
Swift 易忽略的笔记 5):Enumeration & Classes and Structs & Properties总结
1. Enumerationlet somePlanet = Planet.Earthswitch somePlanet {case .Earth: println("Mostly harmless")default: println("Not a safe place for humans")}// prints "Mostly harmless”原创 2014-06-23 13:20:01 · 1014 阅读 · 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 · 985 阅读 · 0 评论 -
Swift 易忽略的笔记 1)
1. 一条语句结尾没有分号;原创 2014-06-21 10:44:37 · 553 阅读 · 0 评论
分享