Hi! In an app implemented using SwiftUI, I want to execute some code when a view changes size. In the previous framework (UIKit), this can be done by using viewWillTransition event in UIViewController, but I cannot find a SwiftUI equivalent now. Do you have an idea how to do that?
More detail of the issue I encountered:
I am following the ADMOB documentation to include adaptive banner ad in the app, and the ADMOB instruction uses the viewWillTransition event
https://developers.google.com/admob/ios/banner/adaptive
I has successfully included a banner app using UIViewRepresentable to wrap the ADMOB object that originally supports UIKit, but just missing the way to respond to layout change of the app (more specifically, rotation).
Thank you!