GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADAdSizeDelegate
@protocol GADAdSizeDelegate <NSObject>
The class implementing this protocol will be notified when the GADBannerView’s ad content
changes size. Any views that may be affected by the banner size change will have time to adjust.
-
Called before the ad view changes to the new size.
Declaration
Swift
func adView(_ bannerView: GADBannerView, willChangeAdSizeTo size: AdSize)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGADAdSizeDelegate\u003c/code\u003e protocol enables a class to be notified about changes in the size of ad content displayed within a \u003ccode\u003eGADBannerView\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eImplementing this protocol allows views to dynamically adjust to size changes before they happen, ensuring a smoother user experience.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eadView:willChangeAdSizeTo:\u003c/code\u003e method is the core of this protocol, signaling an impending size change and providing the new dimensions.\u003c/p\u003e\n"]]],["The `GADAdSizeDelegate` protocol notifies a class when a `GADBannerView`'s ad content changes size. The key action is the `-adView:willChangeAdSizeTo:` method, which is called *before* the ad view changes to a new size. This method provides the affected views the opportunity to adjust to the impending change. The `adView` parameter refers to the `GADBannerView`, and `size` represents the new `GADAdSize`.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADAdSizeDelegate\n=================\n\n @protocol GADAdSizeDelegate \u003cNSObject\u003e\n\nThe class implementing this protocol will be notified when the GADBannerView's ad content\nchanges size. Any views that may be affected by the banner size change will have time to adjust.\n- `\n ``\n ``\n `\n\n ### [-adView:willChangeAdSizeTo:](#/c:objc(pl)GADAdSizeDelegate(im)adView:willChangeAdSizeTo:)\n\n `\n ` \n Called before the ad view changes to the new size. \n\n #### Declaration\n\n Swift \n\n func adView(_ bannerView: ../Classes/GADBannerView.html, willChangeAdSizeTo size: AdSize)\n\n Objective-C \n\n - (void)adView:(nonnull ../Classes/GADBannerView.html *)bannerView\n willChangeAdSizeTo:(../Structs/GADAdSize.html)size;"]]