
Swift 2 Tutorials
aaronmu7
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Chapter 3: Numeric Types & Operations
*In Swift, you can even use the modulo operator with fractional numbers, like so: let moduloDecimal = 11.6 % 1.2 *In Swift, you can't apply the * operator to mixed types. This rules applies原创 2016-09-22 17:33:53 · 239 阅读 · 0 评论 -
Chapter 2: Variables and Constants
*In Swift, you can optionally use underscored to make larger numbers more human-readable. The quantity and placement of the underscores is up to you. *Swift is very strict about the types it uses原创 2015-12-23 12:24:12 · 319 阅读 · 0 评论 -
Swift Tutorial: Repeating Steps with Loops
*Close range: let closedRange = 0...5 Half-open range: let halfOpenRange = 0.. * let count = 10 var sum = 0 for var i = 1; i = count; i++ { sum += i } let count原创 2015-12-21 20:13:22 · 336 阅读 · 0 评论 -
Introduction to Functional Programming in Swift
*Imperative thinking is thinking in terms of algorithms or steps when solving a problem, or the how of getting from A (the problem) to B (the solution). A perfect example of an imperative approach is原创 2015-12-25 11:52:19 · 277 阅读 · 0 评论 -
Introducing Protocol-Oriented Programming in Swift 2
*Becuase types can conform to more than one protocol, they can be decorated with default behaviors from multiple protocols. Unlike multiple inheritance of classes which some programming languages supp原创 2015-12-25 16:18:47 · 307 阅读 · 0 评论 -
Operator Overloading in Swift Tutorial
*Typically, you'll use overloading to extend an operation to a new object while maintaining the original semantics, rather than defining different (and confusing) behavior. *There are three steps原创 2016-01-02 11:38:21 · 269 阅读 · 0 评论 -
Swift Functional Programming Tutorial
*Functional programming is a programming paradigm that emphasizes calculations via mathematical-style functions, immutability and expressiveness, and minimizes the use of variables and state. Since t原创 2016-01-03 17:52:20 · 277 阅读 · 0 评论 -
Custom Subscripting in Swift Tutorial
* subscript(coordinates: (Int,Int)) -> PlayerColor { get { } set { } } sdfsdfsdfsdf sdfsfsdfsdf原创 2015-12-29 19:04:01 · 276 阅读 · 0 评论 -
Swift Generics Tutorial
*Swift has typed arrays and dictionaries. An array of Ints can only hold Ints and can never (for example) contain a String. This means you can document code by writing code, allowing the compiler to d原创 2015-12-28 15:31:03 · 261 阅读 · 0 评论 -
Swift 2 Tutorial
*Declaring things with let whenever possible is best practice, because that will allow the compiler to perform optimizations that it wouldn't be able to do otherwise. *We believe it's better prac原创 2015-12-12 17:37:09 · 239 阅读 · 0 评论