![iOS 12 Programming for Beginners](https://wfqqreader-1252317822.image.myqcloud.com/cover/76/36699076/b_36699076.jpg)
上QQ阅读APP看书,第一时间看更新
Dictionaries
A dictionary is an unordered collection of values, with each one accessed through a unique key. Let's look at the following diagram:
![](https://epubservercos.yuewen.com/2E52D1/19470383901517806/epubprivate/OEBPS/Images/28367bb4-8c95-45e3-8f90-d7d1f994fb8c.png?sign=1739133472-HBLWJ7OGegxS15epdS5RFxrXkL1OXx31-0-fa5aec66f4aa13ceb6e722fa3a1c7896)
In our diagram, we have a dictionary of pizzas (keys) with their prices (values). To find something inside a dictionary, we must look it up according to its key. Let's look at a dictionary syntax:
Dictionary<Key, Value>
Now, that we understand what a dictionary is and its syntax let's look at how we can use it by creating our first dictionary.