# GADBannerView


    @interface GADBannerView : UIView

A view that displays banner ads. See <https://developers.google.com/admob/ios/banner> to get
started.
[## Initialization](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/Initialization)

- `


  ### [-initWithAdSize:origin:](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(im)initWithAdSize:origin:)


  ` Initializes and returns a banner view with the specified ad size and origin relative to the
  banner's superview.

  #### Declaration

  Swift

      init(adSize: AdSize, origin: CGPoint)

  Objective-C

      - (nonnull instancetype)initWithAdSize:(https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Structs/GADAdSize.html)adSize origin:(CGPoint)origin;

- `


  ### [-initWithAdSize:](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(im)initWithAdSize:)


  ` Initializes and returns a banner view with the specified ad size placed at its superview's
  origin.

  #### Declaration

  Swift

      init(adSize: AdSize)

  Objective-C

      - (nonnull instancetype)initWithAdSize:(https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Structs/GADAdSize.html)adSize;

[## Pre-Request](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/Pre-Request)

- `


  ### [adUnitID](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)adUnitID)


  ` 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"

  #### Declaration

  Swift

      var adUnitID: String? { get set }

  Objective-C

      @property (nonatomic, copy, nullable) NSString *adUnitID;

- `


  ### [rootViewController](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)rootViewController)


  ` 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 }

  Objective-C

      @property (nonatomic, weak, nullable) UIViewController *rootViewController;

- `


  ### [adSize](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)adSize)


  ` 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.

  #### Declaration

  Swift

      var adSize: AdSize { get set }

  Objective-C

      @property (nonatomic) https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Structs/GADAdSize.html adSize;

- `


  ### [delegate](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)delegate)


  ` Optional delegate object that receives state change notifications from this GADBannerView.
  Typically this is a UIViewController.

  #### Declaration

  Swift

      @IBOutlet weak var delegate: (any BannerViewDelegate)? { get set }

  Objective-C

      @property (nonatomic, weak, nullable) id<https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Protocols/GADBannerViewDelegate.html> delegate;

- `


  ### [adSizeDelegate](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)adSizeDelegate)


  ` Optional delegate that is notified when creatives cause the banner to change size.

  #### Declaration

  Swift

      @IBOutlet weak var adSizeDelegate: (any AdSizeDelegate)? { get set }

  Objective-C

      @property (nonatomic, weak, nullable) id<https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Protocols/GADAdSizeDelegate.html> adSizeDelegate;

[## Making an Ad Request](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/Making-an-Ad-Request)

- `


  ### [-loadRequest:](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(im)loadRequest:)


  ` Requests an ad. The request object supplies targeting information.

  #### Declaration

  Swift

      func load(_ request: Request?)

  Objective-C

      - (void)loadRequest:(nullable https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADRequest.html *)request;

- `


  ### [-loadWithAdResponseString:](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(im)loadWithAdResponseString:)


  ` Loads the ad and informs \|delegate\| of the outcome.

  #### Declaration

  Swift

      func load(with adResponseString: String)

  Objective-C

      - (void)loadWithAdResponseString:(nonnull NSString *)adResponseString;

- `


  ### [autoloadEnabled](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)autoloadEnabled)


  ` 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.

  #### Declaration

  Swift

      var isAutoloadEnabled: Bool { get set }

  Objective-C

      @property (nonatomic, assign, unsafe_unretained, readwrite,
                getter=isAutoloadEnabled) BOOL autoloadEnabled;

[## Response](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/Response)

- `


  ### [responseInfo](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)responseInfo)


  ` Information about the ad response that returned the current ad or an error. Nil until the first
  ad request succeeds or fails.

  #### Declaration

  Swift

      var responseInfo: ResponseInfo? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADResponseInfo.html *responseInfo;

- `


  ### [placementID](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)placementID)


  ` An identifier for a placement in reporting. This property must be set prior to placing the ad
  into a visible superview.

  #### Declaration

  Swift

      var placementID: Int64 { get set }

  Objective-C

      @property (nonatomic) int64_t placementID;

- `


  ### [isCollapsible](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)isCollapsible)


  ` Indicates whether the last loaded ad is a collapsible banner.

  #### Declaration

  Swift

      var isCollapsible: Bool { get }

  Objective-C

      @property (nonatomic, readonly) BOOL isCollapsible;

[## Deprecated](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/Deprecated)

- `


  ### [paidEventHandler](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADBannerView#/c:objc(cs)GADBannerView(py)paidEventHandler)


  ` Deprecated

  Use \[GADBannerViewDelegate bannerView:didRecordPaidEventWithAdValue:\] instead.
  Called when ad is estimated to have earned money. Available for allowlisted accounts only.

  #### Declaration

  Swift

      var paidEventHandler: https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Type-Definitions.html#/c:GADAdValue.h@T@GADPaidEventHandler? { get set }

  Objective-C

      @property (nonatomic, copy, nullable) https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Type-Definitions.html#/c:GADAdValue.h@T@GADPaidEventHandler paidEventHandler;