- 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.
- .NET之美:.NET關鍵技術深入解析
- 復雜軟件設計之道:領域驅動設計全面解析與實戰
- 數據庫程序員面試筆試真題與解析
- LabVIEW程序設計基礎與應用
- MySQL數據庫應用與管理 第2版
- PostgreSQL for Data Architects
- Machine Learning with R Cookbook(Second Edition)
- Java虛擬機字節碼:從入門到實戰
- Java程序設計與實踐教程(第2版)
- 深入淺出DPDK
- Effective Python Penetration Testing
- 軟件項目管理實用教程
- Learning R for Geospatial Analysis
- Learning Continuous Integration with TeamCity
- Creating Data Stories with Tableau Public