struct BannerContentView : View {
let navigationTitle : String
// [START add_banner_to_view]
var body : some View {
GeometryReader { geometry in
VStack {
Spacer ()
HStack {
Spacer ()
var adSize = currentOrientationAnchoredAdaptiveBanner(width: geometry. size . width * 0.90 )
BannerViewContainer (adSize)
. frame ( width : adSize. size . width , height : adSize. size . height )
Spacer ()
}
}
. navigationTitle ( navigationTitle )
}
}
}
Hi,
I've raised this concern to the wider team and will get back to you once I receive any updates on it. Meanwhile, your patience is highly appreciated.
[2025-08-06 15:11:26Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01syF2I:ref" (ADR-00328870)
Hi,
We received an update from the wider team that
GeometryReader
is not the most reliable API for handling orientation changes in SwiftUI. Instead, it's recommended to use UIKit notifications or the
sizeClass
environment variable (e.g.,
@Environment(\.horizontalSizeClass) var horizontalSizeClass
) to respond to size change events.
I hope this helps! Let me know if you have any other questions.
[2025-09-03 18:59:46Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01syF2I:ref" (ADR-00328870)