Scroll Programmatically with ScrollViewReader in a NavigationLink - iTunes Search API - PART 7/7

preview_player
Показать описание
In the 7th part of the iTunes Search API tutorial series, we will implement the detail view for songs. This includes programmatically scrolling to the selected song when the detail view appears.
We need to do 2 fetch requests when opening the NavigationLink, which is done with 2 separate view models. These make the code more organised and reusable.
Last I want to change the minimum deployment target back from iOS 16 to 15. Therefore I need to show part of the code conditionally by checking the available iOS version and having an alternative for the Grid view-

Overview
00:00 Introduction
03:14 NavigationLink to Song Detail View
05:27 Song Detail View
5:39 fetching the data for Song Detail View
14:55 Reusable view for Album Header
19:36 Scroll programmatically with ScrollViewReader
33:06 onAppear vs onChange, how to update the UI
38:21 conditionally show views for different iOS versions
43:37 wrap up

If you liked what you learned and you want to see more, check out one of my courses!
👩🏻‍💻 Combine course

⬇️ Project file for starting point:

⬇️ End:

#SwiftUI #AsyncImage
Рекомендации по теме
Комментарии
Автор

Thanks for this great work, I've learn many things! Hope you get the time to do more like this. Thank you 🙂

EricTMCode
Автор

Really great tutorial! Thank you for all of the work you put into this! I did notice while playing around with my finished project that there is an issue with multiple *disc* albums. In this case, track numbers get repeated (track number 1 on disc 1 and track number 1 on disc 2, etc), so ordering by track number doesn't always work out well. In addition to that, using the track number as the id for the scroll reader proxy isn't reliable in this case either. I found that using the song id works better. Cheers!

thebrandontyler
Автор

Hi, do you think being iOS dev is good career path if I want to be full time freelancer? Lot of ppl saying best way for freelance is web dev but I really like swift over other languages

ShredzZ_SteamDeck_Gameplays
join shbcf.ru