It turns out that Attempt 2 works even with initial viewWidth = .zero. However, the problem is that if I insert the banner in a List, viewDidAppear(animated:) never triggers, so width never gets updated.
Does anyone know how to work around this?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: