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:
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:
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...