- 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.
- Java多線程編程實戰指南:設計模式篇(第2版)
- 零基礎學Scratch少兒編程:小學課本中的Scratch創意編程
- Ext JS Data-driven Application Design
- 秒懂設計模式
- Eclipse Plug-in Development:Beginner's Guide(Second Edition)
- C語言程序設計學習指導與習題解答
- Learning DHTMLX Suite UI
- Android開發案例教程與項目實戰(在線實驗+在線自測)
- 青少年信息學競賽
- Scratch3.0趣味編程動手玩:比賽訓練營
- Principles of Strategic Data Science
- IoT Projects with Bluetooth Low Energy
- PHP項目開發全程實錄(第4版)
- Spring Data JPA從入門到精通
- ArcGIS Blueprints