TelemetryViewer
TelemetryViewer copied to clipboard
Show Favourites on Front Screen
- [ ] Server: Allow Insights to be marked as favourites
- [ ] Server: Get list of favourite insights
- [ ] Client: Show Favourite insights on front screen
Please let me know when you find a solution to this, I am facing a similar issue in Theatrical Trailers.
This might be helpful: Programmatic navigation in SwiftUI NavigationView. In Theatrical Trailers, I solved this by selecting the first model item when the app loads.
In List.body
:
let viewModel = data.enumerated().map { ListItem(data: $0.1, isSelected: $0.0 == 0) }
return NavigationView {
ForEach(listItem) { item in
ListRow(model: $item)
}
}
Calculating the viewModel
inside body
might be problematic, however it is working fine so far. It could easily be moved e. g. to init
.
In ListRow.body
:
NavigationLink(destination: …, isActive: $model.isSelected)
// views
}