- 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.
- 數據科學實戰手冊(R+Python)
- Learning Java Functional Programming
- R語言數據分析從入門到精通
- Java 9 Concurrency Cookbook(Second Edition)
- Rust編程:入門、實戰與進階
- HTML5+CSS3基礎開發教程(第2版)
- PhpStorm Cookbook
- C語言程序設計上機指導與習題解答(第2版)
- Getting Started with React Native
- C語言程序設計實訓教程與水平考試指導
- Mastering jQuery Mobile
- Java程序設計教程
- Java高并發編程詳解:深入理解并發核心庫
- Python預測分析與機器學習
- Learning Apache Thrift