Really exciting that we're able to use Wave in SwiftUI. Couple of questions:
- Should animators be held via
@State to avoid instantiating new instances each time views are rendered?
|
let offsetAnimator = SpringAnimator<CGPoint>(spring: Spring(dampingRatio: 0.72, response: 0.7)) |
- Seems like this works by updating
boxOffset and triggering a state change in SwiftUI - I wonder if there's a more performant way to do this? TimelineView perhaps?
|
@State var boxOffset: CGPoint = .zero |
Really exciting that we're able to use Wave in SwiftUI. Couple of questions:
@Stateto avoid instantiating new instances each time views are rendered?Wave/Sample App/Wave-Sample/Wave-Sample/SwitUIViewController.swift
Line 14 in ecf541b
boxOffsetand triggering a state change in SwiftUI - I wonder if there's a more performant way to do this?TimelineViewperhaps?Wave/Sample App/Wave-Sample/Wave-Sample/SwitUIViewController.swift
Line 16 in ecf541b