Let's wrap up the Favoriting feature for our application by implementing a couple of different fixes. First let's show a heart image for podcasts that we have already favorited. Then we'll highlight our Tab Bar with a little badge value whenever we perform a favorite. Finally, let's put in a fix that allows us to load podcast episodes when we tap into a favorite.
Comments (5)
Prabhdeep Singh Randhawa
6 years ago
almost there at last.I hope we gonna finish this series by this weekend.
juliolocoh
6 years ago
Brian can you please include in the course the top 20 podcasts i mean the podcasts that are the most listen to thanks
Brian Voong
6 years ago
juliolocoh
6 years ago
thanks Brian
st4n
5 years ago
deleting last favorited podcast is crashing the app.. index out of range..
Dew Douglass
5 years ago
What code did you write to delete the favorited podcast?
Flip902
5 years ago
Brian, thank you again. Just wondering how you would go about deleting the podcast if you clicked the heart? In my app I have a star inside a cell in a tableview. when clicked It favourites the item in that cell and displays it in favourites section. I would like to be able to delete the items by toggling the star right from the cell. This video is exactly what I needed. I'm having a hard time finding the right way to delete the item from the array because the indexPath in the cell is not the same as the indexPath of the favourites array so I don't know how to delete the item. Any help is appreciated. Thanks!
Brian Voong
5 years ago
Flip902
5 years ago
Yes It does! just so I'm on the same page... when I loop through the array just check that it matches the name of the podcast, delete that one, and save the new array into userDefaults?Thanks for pointing me in the right direction!
Dew Douglass
5 years ago
Why is
UIApplication.mainTabBarController()?.viewControllers?[1].tabBarItem.badgeValue = nil
not the same as
self.tabBarItem.badgeValue = nil