scroll: allow any hashable target

This commit is contained in:
William Casarin
2023-08-01 21:51:41 -07:00
parent d4aa8a5602
commit 15ab9f7135

View File

@@ -21,7 +21,7 @@ struct EventDetailView_Previews: PreviewProvider {
}
}
func scroll_to_event(scroller: ScrollViewProxy, id: String, delay: Double, animate: Bool, anchor: UnitPoint = .bottom) {
func scroll_to_event<ID: Hashable>(scroller: ScrollViewProxy, id: ID, delay: Double, animate: Bool, anchor: UnitPoint = .bottom) {
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
if animate {
withAnimation {