- Swift 4 Programming Cookbook
- Keith Moon
- 144字
- 2021-07-08 10:21:26
Structs
Objects are great for encapsulating data and functionality behind a unifying and referenceable concept, such as a person. However, not everything is an object; we may have a set of data that is logically grouped together, but that isn't much more than that. It's not more than the sum of its parts--it is the sum of its parts.
For this, there are structs. Short for structure, structs can be found in the C programming language and were, therefore, available in Objective-C, which was built on top of C. If you are familiar with iOS/macOS development, CGRect is an example of a C struct.
Structs are value types, as opposed to classes, which are reference types, and as such behave differently when passed around. In this recipe, we will examine how structs work in Swift, and learn when and how to use them.
- Vue.js設計與實現
- Instant Testing with CasperJS
- JavaScript從入門到精通(微視頻精編版)
- 樂高機器人設計技巧:EV3結構設計與編程指導
- Mastering Julia
- Full-Stack Vue.js 2 and Laravel 5
- Python機器學習經典實例
- C語言程序設計學習指導與習題解答
- Oracle 18c 必須掌握的新特性:管理與實戰
- Creating Mobile Apps with jQuery Mobile(Second Edition)
- HTML5+CSS3 Web前端開發技術(第2版)
- Scala Reactive Programming
- 新印象:解構UI界面設計
- Hack與HHVM權威指南
- HTML5 WebSocket權威指南