Hello,
I have an @EnvironmentObject
variable that publishes 30 times per second but the view that depends on that data must be limited to 20 frames per second. The publishing rate cannot be controlled, so I must control the rate at which SwiftUI refreshes that view in order to achieve the desired effect.
I tried using TimelineView(.periodic(from: .now, by: 1/20))
, but the restriction gets ignored due to the published data; I also considered Combine
's timer
, but it isn't based on real time. Are there any other methods I can use to force SwiftUI to refresh certain views at certain real time intervals, in essence controlling its FPS?