Search code examples
iosiphonexcodeswiftiad

iAd adBannerView.adType.rawValue values?


Another quick question on IOS Swift iAd

I came across the [adType.rawValue] element and wonder has anybody got a detail information of what values did this element carry ?

adBannerView.adType.rawValue

so far whenever the "test ads" banner from iAd appear it will carry a value of "0" (zero), it didn't mentioned in details on Developer resources.

your kind reply is greatly appreciated.

Thanking you guys in advanced.

best regards.


Solution

  • This probably isn’t going to be as exciting as you’d hoped, and it isn’t really related to iAd.

    ADAdType is just an enum, with possible values of Banner or MediumRectangle. Enums can have an underlying raw representation type, and ADAdType’s is Int. .rawValue gives you access to its underlying representation for a given enum value – for .Banner it’ll be 0, for .MediumRectangle it’ll be 1.