I am using ForEach() inside a Picker, but the debug gives an error.
Xcode Version 11.2 (11B52)
Below is my swift code
var radiusRangeKM = Array((stride(from: 50, to: 2010, by: 10)))
var body: some View {
NavigationView {
//TODO: Form Set Up
Form {
Section() {
Picker(selection: $selectedRadius, label: Text("Radius(KM)")) {
ForEach(0 ..< radiusRangeKM.count, id: \.self) {
Text(String(self.radiusRangeKM[$0])).tag($0)
}
}
}
}
.navigationBarTitle(Text("Settings"))
}
}
Below is the error from debug window
[TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <_TtC7SwiftUIP33_BFB370BA5F1BADDC9D83021565761A4925UpdateCoalescingTableView: 0x7f9d5e98b000; baseClass = UITableView; frame = (0 0; 414 842); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = ; layer = ; contentOffset: {0, -108}; contentSize: {414, 8702.0000000000109}; adjustedContentInset: {108, 0, 34, 0}; dataSource: <_TtGC7SwiftUIP13$7fff2c6b223419ListCoreCoordinatorGVS_20SystemListDataSourceOs5Never_GOS_19SelectionManagerBoxS2___: 0x7f9d5cf80c50>>