Update:
I also tried this code, but even then no result. It doesn't display anything and yet it compiles without any problem
class ViewController: UIViewController {
struct ContentView : View {
var body: some View {
VStack {
Text("Google Mobile Ads")
GADBannerViewController()
}
}
}
// MARK: - Setting Google View Mobile Ads
struct GADBannerViewController : UIViewControllerRepresentable{
func makeUIViewController(context: Context) -> some UIViewController {
let view = GADBannerView(adSize: GADAdSizeBanner)
let viewController = UIViewController()
let testID = "ca-app-pub-3940256099942544/2934735716"
view.adUnitID = testID
view.rootViewController = viewController
//
viewController.view.addSubview(view)
viewController.view.frame = CGRect(origin: .zero, size: GADAdSizeBanner.size)
//Load Ads
view.load(GADRequest())
//view.backgroundColor = .secondarySystemBackground
return viewController
}
Post
Replies
Boosts
Views
Activity
A big thank you to all of you. My application is compiling, now there is a problem: The content of my json file does not appear I do not know why. Here is the link of the json file.
https://drive.google.com/file/d/1qMKLNcf1fvYla21Yhh_D36FuPI-0-kj2/view?usp=drivesdk
here is the code to display the chapters but I don't know why nothing is displayed
https://drive.google.com/file/d/1BFUzbk0fQB2mLotmvGPsS1FBkZlRIzSB/view?usp=sharing
that's my ChaptersViewController
please help me