Learn iOS with Examples, Code Snippets and Video Tutorials

Swift 2.0 Basics Video Tutorial – Iterating through Dictionaries to look up keys and values

Swift 2.0 Basics Video Tutorial –  Iterating through Dictionaries to look up keys and values

In this Swift 2 video tutorial we will create a Dictionary type variable, which can contain key & value pairs. In our example we use a String based key (park attractions at DisneyWorld) and an Int value (a hypothetical hill difficulty to get to the attraction). We’ll tie together a lot of our past examples, by creating a function that takes in an attraction name as the input argument, iterates through the Dictionary and returns an Int value representing the difficulty.

Check out our premium Swift and Sprite Kit Tutorial content!

Visit CartoonSmart.com