Skip to content

Commit

Permalink
Update Swift学习:从Objective-C到Swift.md
Browse files Browse the repository at this point in the history
conmuted->computed
  • Loading branch information
谢伟志 committed Aug 31, 2015
1 parent fe54a74 commit b68680e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Shape {
- `Stored Properties`和`Computed properties`
在Swift中,property被分为两类:`Stored Properties`和`Computed properties`
简单来说,就是stored properties 能够保存值,而conmuted properties只提供getter与setter,利用stored properties来生成自己的值。个人感觉Computed properties更像方法,而不是传统意义的属性。但是这样一个特性存在,使得我们更容易组织我们的代码。
简单来说,就是stored properties 能够保存值,而computed properties只提供getter与setter,利用stored properties来生成自己的值。个人感觉Computed properties更像方法,而不是传统意义的属性。但是这样一个特性存在,使得我们更容易组织我们的代码。
延伸阅读:[computed property vs function](http://stackoverflow.com/questions/24035276/computed-read-only-property-vs-function-in-swift)
Expand Down Expand Up @@ -799,4 +799,4 @@ if let thisSementTitle = dataSource?.titleFroSegmentAtIndex?(index){
1. [The Swift Programming Language](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language)
2. [Apple Swift Blog](https://developer.apple.com/swift/blog/)
3. [Using Swift with Cocoa and Objective-C](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/)


0 comments on commit b68680e

Please sign in to comment.