- Mastering Swift
- Jon Hoffman
- 178字
- 2021-07-16 14:12:14
Swift collection types
A collection is a group or store of data that has a shared significance. Swift provides two native collection types for storing data. These collection types are known as arrays and dictionaries. An array will store the data in an ordered list, while a dictionary will store the data in an unordered list. In an array, we access the data by the location (index) in the array, while the data in a dictionary is accessed using a unique key that is associated with the value we want.
The data stored in a Swift collection is required to be of the same type. This means, as an example, that we are unable to store a string and an int in the same array. Since Swift does not allow us to mismatch data types in a collection, we can be certain of the data type when we retrieve data from a collection. This is another feature, which on the surface might seem like a shortcoming, but is actually a design feature that helps eliminate common programming mistakes.
- 程序員修煉之道:程序設計入門30講
- Web應用系統開發實踐(C#)
- Python自動化運維快速入門(第2版)
- 數據庫系統原理及MySQL應用教程
- 人臉識別原理及算法:動態人臉識別系統研究
- PHP+MySQL+Dreamweaver動態網站開發實例教程
- 青少年信息學競賽
- Java系統化項目開發教程
- Practical Game Design with Unity and Playmaker
- Android傳感器開發與智能設備案例實戰
- C語言程序設計習題與實驗指導
- Learning Python Data Visualization
- MySQL 8從零開始學(視頻教學版)
- Visual Basic語言程序設計基礎(第3版)
- Elasticsearch Blueprints