GoogleMobileAds Framework Reference  |  iOS  |  Google for Developers | Latest TMZ Celebrity News & Gossip | Watch TMZ Live

GoogleMobileAds Framework Reference

GAMBannerView


@interface GAMBannerView : GADBannerView

The view that displays Ad Manager banner ads.

To request this ad type using GADAdLoader, you need to pass GADAdLoaderAdTypeGAMBanner (see GADAdLoaderAdTypes.h) to the |adTypes| parameter in GADAdLoader’s initializer method. If you request this ad type, your delegate must conform to the GAMBannerAdLoaderDelegate protocol.

  • Required value created on the Ad Manager 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 Ad Manager ad unit ID: @“/6499/example/banner”

    Declaration

    Swift

    var adUnitID: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *adUnitID;
  • Optional delegate that is notified when creatives send app events.

    Declaration

    Swift

    @IBOutlet weak var appEventDelegate: (any AppEventDelegate)? { get set }

    Objective-C

    @property (nonatomic, weak, nullable) id<GADAppEventDelegate> appEventDelegate;
  • 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<GADAdSizeDelegate> adSizeDelegate;
  • Optional array of NSValue encoded GADAdSize structs, specifying all valid sizes that are appropriate for this slot. Never create your own GADAdSize directly. Use one of the predefined standard ad sizes (such as GADAdSizeBanner), or create one using the GADAdSizeFromCGSize method.

    Example:

    \code NSArray *validSizes = @[ NSValueFromGADAdSize(GADAdSizeBanner), NSValueFromGADAdSize(GADAdSizeLargeBanner) ];

    bannerView.validAdSizes = validSizes; \endcode

    Declaration

    Swift

    var validAdSizes: [NSValue]? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<NSValue *> *validAdSizes;
  • Indicates that the publisher will record impressions manually when the ad becomes visible to the user.

    Declaration

    Swift

    var enableManualImpressions: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL enableManualImpressions;
  • Video controller for controlling video rendered by this ad view.

    Declaration

    Swift

    var videoController: VideoController { get }

    Objective-C

    @property (nonatomic, readonly, nonnull) GADVideoController *videoController;
  • If you’ve set manualImpressionsEnabled to YES, call this method when the ad is visible.

    Declaration

    Swift

    func recordImpression()

    Objective-C

    - (void)recordImpression;
  • Use this function to resize the banner view without launching a new ad request.

    Declaration

    Swift

    func resize(_ size: AdSize)

    Objective-C

    - (void)resize:(GADAdSize)size;
  • Sets options that configure ad loading.

    Declaration

    Swift

    func setAdOptions(_ adOptions: [GADAdLoaderOptions])

    Objective-C

    - (void)setAdOptions:(nonnull NSArray<GADAdLoaderOptions *> *)adOptions;

    Parameters

    adOptions

    An array of GADAdLoaderOptions objects. The array is deep copied and option objects cannot be modified after calling this method.

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.