GoogleMobileAds Framework Reference

Functions

The following functions are available globally.

  • Returns a custom GADAdSize for the provided CGSize. Use this only if you require a non-standardsize. Otherwise, use one of the standard size constants above.

    Declaration

    Swift

    funcGADAdSizeFromCGSize(_size:CGSize)->GADAdSize
  • Returns a custom GADAdSize that spans the full width of the application in portrait orientationwith the height provided.

    Declaration

    Swift

    funcGADAdSizeFullWidthPortraitWithHeight(_height:CGFloat)->GADAdSize
  • Returns a custom GADAdSize that spans the full width of the application in landscape orientationwith the height provided.

    Declaration

    Swift

    funcGADAdSizeFullWidthLandscapeWithHeight(_height:CGFloat)->GADAdSize
  • Returns the closest valid ad size from possibleAdSizes as compared to |original|. The selectedsize must be smaller than or equal in size to the original. The selected size must also bewithin a configurable fraction of the width and height of the original. If no valid size exists,returns kGADAdSizeInvalid.

    Declaration

    Swift

    funcGADClosestValidSizeForAdSizes(_original:GADAdSize,_possibleAdSizes:[NSValue])->GADAdSize

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2021-03-03 UTC.