Post

Replies

Boosts

Views

Activity

All Views double loading in List/NavigationLink on iOS14, MAJOR BUG
Why is the following code causing views to load twice on iOS 14? This does not happen on iOS 13.6. The same code compiled on either Xcode 12 Beta 3 or Xcode 11.6 runs differently on iOS 14. iOS 14 is causing all Views to load twice when placed in a List with NavigationLink. This issue is doubling our network traffic. The following code example will demonstrate: import SwiftUI struct ContentView: View { 		var body: some View { 				NavigationView { 						List(){ 								NavigationLink( destination: DetailView()){ 										Text("DetailView") 								} 						} 				} 		} } struct DetailView: View { 		 var body: some View { 					 VStack { 							 logView("View loaded") 							 Text("Hello, world!") 					 } 			 } 			 			 func logView( _ message: String) -> AnyView { 					 print("\(message)") 					 return AnyView(EmptyView()) 			 } }
4
0
1.8k
Jul ’20