Integrating AdMob right into a SwiftUI app, the Google pattern code makes use of a UIViewController to show banner advert. The banner view, stretches to the utmost potential peak, inflicting show points. the next code demonstrates the problems:
struct SomeScreen: View {
var physique: some View {
VStack {
Textual content("Some textual content")
Spacer()
BannerContentView(navigationTitle: "Banner").background(.purple)
}
}
}
BannerContentView implementation is taken from right here: https://github.com/googleads/googleads-mobile-ios-examples/blob/predominant/Swift/superior/SwiftUIDemo/SwiftUIDemo/Banner/BannerContentView.swift (Copy / Pasted)
As may be seen within the screenshot, the BannerContentView consumes as a lot house as potential, having the Spacer() don’t have any impact. How can I modify BannerContentView which inherits UIViewController to take solely the house required by the banner?

