- iOS 12 Programming for Beginners
- Craig Clayton
- 35字
- 2021-07-02 15:05:03
Iterating over dictionary keys
To iterate over a dictionary's keys using a for...in loop, add the following to Playgrounds:
for key in dictPizzas.keys { print(key) }
Your code and output should now look like this:
![](https://epubservercos.yuewen.com/2E52D1/19470383901517806/epubprivate/OEBPS/Images/796c67fc-f944-4553-9cbd-b922085ae32d.png?sign=1739123762-cgXvMNHgNltatjCysoiUB8kW2OkNbniq-0-de6b00bfa8c229e4a87209b70b298a4e)