Required value created on the AdMob website. Create a new ad unit for every unique placement of
an ad in your application. Set this to the ID assigned for this placement. Ad units are
important for targeting and statistics.
Example AdMob ad unit ID: @“ca-app-pub-0123456789012345/0123456789”
Reference to a root view controller that is used by the banner to present full screen
content after the user interacts with the ad. If this is nil, the view controller containing the
banner view is used.
Declaration
Swift
@IBOutlet weak var rootViewController: UIViewController? { get set }
Required to set this banner view to a proper size. Never create your own GADAdSize directly.
Use one of the predefined standard ad sizes (such as GADAdSizeBanner), or create one using the
GADAdSizeFromCGSize method. If not using mediation, then changing the adSize after an ad has
been shown will cause a new request (for an ad of the new size) to be sent. If using mediation,
then a new request may not be sent.
A Boolean value that determines whether autoloading of ads in the receiver is enabled. If
enabled, you do not need to call the loadRequest: method to load ads.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGADBannerView\u003c/code\u003e is a UIView subclass used to display banner ads in iOS apps, requiring an ad unit ID and ad size for initialization.\u003c/p\u003e\n"],["\u003cp\u003eBefore making an ad request, set the \u003ccode\u003eadUnitID\u003c/code\u003e, \u003ccode\u003erootViewController\u003c/code\u003e, and \u003ccode\u003eadSize\u003c/code\u003e properties of the \u003ccode\u003eGADBannerView\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo load an ad, call \u003ccode\u003eloadRequest:\u003c/code\u003e with a \u003ccode\u003eGADRequest\u003c/code\u003e object, providing targeting information, or enable \u003ccode\u003eautoloadEnabled\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use delegates like \u003ccode\u003eGADBannerViewDelegate\u003c/code\u003e and \u003ccode\u003eGADAdSizeDelegate\u003c/code\u003e to receive notifications about the banner's state and size changes.\u003c/p\u003e\n"],["\u003cp\u003eAfter an ad loads, information about the response is available through the \u003ccode\u003eresponseInfo\u003c/code\u003e property.\u003c/p\u003e\n"]]],["`GADBannerView` displays banner ads and requires initialization with an ad size, either with a specified origin or at the superview's origin. Key actions include setting the `adUnitID` from AdMob, designating the `rootViewController`, configuring the `adSize`, and optionally assigning `delegate` and `adSizeDelegate`. To request an ad, use `loadRequest:` or `loadWithAdResponseString:`. Ad loading can be automated via `autoloadEnabled`. Information on the ad response is available through `responseInfo` and `isCollapsible` will show if the last loaded ad is collapsible.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADBannerView\n=============\n\n\n @interface GADBannerView : UIView\n\nA view that displays banner ads. See \u003chttps://developers.google.com/admob/ios/banner\u003e to get\nstarted.\n[Initialization\n--------------](#/Initialization)\n\n- `\n ``\n ``\n `\n\n ### [-initWithAdSize:origin:](#/c:objc(cs)GADBannerView(im)initWithAdSize:origin:)\n\n `\n ` \n Initializes and returns a banner view with the specified ad size and origin relative to the\n banner's superview. \n\n #### Declaration\n\n Swift \n\n init(adSize: AdSize, origin: CGPoint)\n\n Objective-C \n\n - (nonnull instancetype)initWithAdSize:(../Structs/GADAdSize.html)adSize origin:(CGPoint)origin;\n\n- `\n ``\n ``\n `\n\n ### [-initWithAdSize:](#/c:objc(cs)GADBannerView(im)initWithAdSize:)\n\n `\n ` \n Initializes and returns a banner view with the specified ad size placed at its superview's\n origin. \n\n #### Declaration\n\n Swift \n\n init(adSize: AdSize)\n\n Objective-C \n\n - (nonnull instancetype)initWithAdSize:(../Structs/GADAdSize.html)adSize;\n\n[Pre-Request\n-----------](#/Pre-Request)\n\n- `\n ``\n ``\n `\n\n ### [adUnitID](#/c:objc(cs)GADBannerView(py)adUnitID)\n\n `\n ` \n Required value created on the AdMob website. Create a new ad unit for every unique placement of\n an ad in your application. Set this to the ID assigned for this placement. Ad units are\n important for targeting and statistics.\n\n Example AdMob ad unit ID: @\"ca-app-pub-0123456789012345/0123456789\" \n\n #### Declaration\n\n Swift \n\n var adUnitID: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *adUnitID;\n\n- `\n ``\n ``\n `\n\n ### [rootViewController](#/c:objc(cs)GADBannerView(py)rootViewController)\n\n `\n ` \n Reference to a root view controller that is used by the banner to present full screen\n content after the user interacts with the ad. If this is nil, the view controller containing the\n banner view is used. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var rootViewController: UIViewController? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIViewController *rootViewController;\n\n- `\n ``\n ``\n `\n\n ### [adSize](#/c:objc(cs)GADBannerView(py)adSize)\n\n `\n ` \n Required to set this banner view to a proper size. Never create your own GADAdSize directly.\n Use one of the predefined standard ad sizes (such as GADAdSizeBanner), or create one using the\n GADAdSizeFromCGSize method. If not using mediation, then changing the adSize after an ad has\n been shown will cause a new request (for an ad of the new size) to be sent. If using mediation,\n then a new request may not be sent. \n\n #### Declaration\n\n Swift \n\n var adSize: AdSize { get set }\n\n Objective-C \n\n @property (nonatomic) ../Structs/GADAdSize.html adSize;\n\n- `\n ``\n ``\n `\n\n ### [delegate](#/c:objc(cs)GADBannerView(py)delegate)\n\n `\n ` \n Optional delegate object that receives state change notifications from this GADBannerView.\n Typically this is a UIViewController. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var delegate: (any BannerViewDelegate)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/GADBannerViewDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n ### [adSizeDelegate](#/c:objc(cs)GADBannerView(py)adSizeDelegate)\n\n `\n ` \n Optional delegate that is notified when creatives cause the banner to change size. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var adSizeDelegate: (any AdSizeDelegate)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/GADAdSizeDelegate.html\u003e adSizeDelegate;\n\n[Making an Ad Request\n--------------------](#/Making-an-Ad-Request)\n\n- `\n ``\n ``\n `\n\n ### [-loadRequest:](#/c:objc(cs)GADBannerView(im)loadRequest:)\n\n `\n ` \n Requests an ad. The request object supplies targeting information. \n\n #### Declaration\n\n Swift \n\n func load(_ request: Request?)\n\n Objective-C \n\n - (void)loadRequest:(nullable ../Classes/GADRequest.html *)request;\n\n- `\n ``\n ``\n `\n\n ### [-loadWithAdResponseString:](#/c:objc(cs)GADBannerView(im)loadWithAdResponseString:)\n\n `\n ` \n Loads the ad and informs \\|delegate\\| of the outcome. \n\n #### Declaration\n\n Swift \n\n func load(with adResponseString: String)\n\n Objective-C \n\n - (void)loadWithAdResponseString:(nonnull NSString *)adResponseString;\n\n- `\n ``\n ``\n `\n\n ### [autoloadEnabled](#/c:objc(cs)GADBannerView(py)autoloadEnabled)\n\n `\n ` \n A Boolean value that determines whether autoloading of ads in the receiver is enabled. If\n enabled, you do not need to call the loadRequest: method to load ads. \n\n #### Declaration\n\n Swift \n\n var isAutoloadEnabled: Bool { get set }\n\n Objective-C \n\n @property (nonatomic, assign, unsafe_unretained, readwrite,\n getter=isAutoloadEnabled) BOOL autoloadEnabled;\n\n[Response\n--------](#/Response)\n\n- `\n ``\n ``\n `\n\n ### [responseInfo](#/c:objc(cs)GADBannerView(py)responseInfo)\n\n `\n ` \n Information about the ad response that returned the current ad or an error. Nil until the first\n ad request succeeds or fails. \n\n #### Declaration\n\n Swift \n\n var responseInfo: ResponseInfo? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) ../Classes/GADResponseInfo.html *responseInfo;\n\n- `\n ``\n ``\n `\n\n ### [paidEventHandler](#/c:objc(cs)GADBannerView(py)paidEventHandler)\n\n `\n ` \n Called when ad is estimated to have earned money. Available for allowlisted accounts only. \n\n #### Declaration\n\n Swift \n\n var paidEventHandler: ../Type-Definitions.html#/c:GADAdValue.h@T@GADPaidEventHandler? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) ../Type-Definitions.html#/c:GADAdValue.h@T@GADPaidEventHandler paidEventHandler;\n\n- `\n ``\n ``\n `\n\n ### [placementID](#/c:objc(cs)GADBannerView(py)placementID)\n\n `\n ` \n An identifier for a placement in reporting. This property must be set prior to placing the ad\n into a visible superview. \n\n #### Declaration\n\n Swift \n\n var placementID: Int64 { get set }\n\n Objective-C \n\n @property (nonatomic) int64_t placementID;\n\n- `\n ``\n ``\n `\n\n ### [isCollapsible](#/c:objc(cs)GADBannerView(py)isCollapsible)\n\n `\n ` \n Indicates whether the last loaded ad is a collapsible banner. \n\n #### Declaration\n\n Swift \n\n var isCollapsible: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL isCollapsible;"]]