To get our data out of the plist, add the following method above loadData() inside of ExploreDataManager:
func fetch() {
for data in loadData() {
print(data)
}
}
Our fetch() method is going to loop through our dictionary data from the plist. Here is what your file should look like now:
![](https://static.packt-cdn.com/products/9781789348668/graphics/assets/fd96c612-2942-421f-8e4f-9b4ff3567be3.png)
Inside of your ExploreViewController.swift file, delete the previous print statement that was inside your viewDidLoad() and replace it with the following:
let manager = ExploreDataManager()
manager.fetch()
Let's build and run the project by hitting the Play button (or use command + R). You will notice that, in the Debug Panel, every time our loop runs, it gives a dictionary object, such as the following:
![](https://static.packt-cdn.com/products/9781789348668/graphics/assets/15116a6b-0f9c-41cb-abe4-eaeaa99d6295.png)
The above print statement is exactly what we want. Now, inside of ExploreDataManager, add the following above our fetch method:
fileprivate var items:[ExploreItem] = []
Next...