damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

EventDetailView.swift (763B)


      1 //
      2 //  ThreadView.swift
      3 //  damus
      4 //
      5 //  Created by William Casarin on 2022-04-16.
      6 //
      7 
      8 import SwiftUI
      9 
     10 
     11 struct EventDetailView: View {
     12     var body: some View {
     13         Text(verbatim: "EventDetailView")
     14     }
     15 }
     16 
     17 struct EventDetailView_Previews: PreviewProvider {
     18     static var previews: some View {
     19         let _ = test_damus_state
     20         EventDetailView()
     21     }
     22 }
     23 
     24 func scroll_to_event<ID: Hashable>(scroller: ScrollViewProxy, id: ID, delay: Double, animate: Bool, anchor: UnitPoint = .bottom) {
     25     DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
     26         if animate {
     27             withAnimation {
     28                 scroller.scrollTo(id, anchor: anchor)
     29             }
     30         } else {
     31             scroller.scrollTo(id, anchor: anchor)
     32         }
     33     }
     34 }