In SwiftUI, you should be aware of a certain behavior with NavigationLinks. By default, your destination views will be loaded into memory whenever your application starts. In other words, our CategoryDetailsView is loaded immediately and hits the network without the user even tapping anything.
This is quite aggressive and instead I want to present an on-demand approach to lazily load our views.
StackOverflow post:
https://stackoverflow.com/questions/57594159/swiftui-navigationlink-loads-destination-view-immediately-without-clicking
Comments (1)
MaxApp
3 years ago
Hey Brian, wouldn't this be good for some apps since the user don't have to wait for the views to populate the items? Thanks.
MaxApp
3 years ago
Also if you click on arts view then you leave but then you click on it again it creates another request which the means the user have to use more data every time the view is presented!