Appears that it's well known issue/feature that still exists.
Stack Overflow - https://stackoverflow.com/questions/63934037/swiftui-navigationlink-cell-in-a-form-stays-highlighted-after-detail-pop/67282150#67282150
The problem for me was that I had other SwiftUI view located between NavigationView and List and that issue arises. Don't know why, but if that view would be moved below List then the row is deselected without problem when returning from child view. But I found solution that fixed this behaviour.
Added to that SwiftUI view that is between NavigationView and List, .zIndex() modifier that must be higher than for the List and now rows is deselected correctly.
struct MostPopularView: View {
var body: some View {
VStack(alignment: .leading, spacing: 20) {
SelectPeriodView()
.padding(.horizontal)
.onChange(of: mostPopularViewModel.selectedPeriod, perform: { _ in
self.loadData()
})
.zIndex(1.0)
List(mostPopularViewModel.articles) { article in
NavigationLink(
destination: ArticleView(article: article),
label: {ArticleListItem(article: article)})
}
}
}
}
Post
Replies
Boosts
Views
Activity
My suggestion is to get an iOS book such as Hacking With Swift iOS by Paul Hudson or App Development with Swift by Apple or any other (those are just my personal recommendations) and read it. You will be introduced with all the steps required to start creating app. I've started learning myself App Development year ago and these books helped me to start understand everything step by step. It's not easy in the beginning but things will come together after some time. I probably wouldn't recommend start learning from Youtube videos or Udemy courses, these can be taken after you've gained some initial skills.
Good luck with your journey!