This seems like it should be simple, but the documentation is very unclear. In the introduction of the ADBannerView
class, Apple says this:
A banner view must always use one of the standard sizes defined in Content Size Identifiers. This is to ensure that the advertisement is drawn correctly. You configure the banner view’s
requiredContentSizeIdentifiers
property with the set of possible sizes your view is allowed to use in your application. To change the size of the banner view, do not set the bounds directly; instead set thecurrentContentSizeIdentifier
property to one of the size identifiers included in that set. You can retrieve the actual dimensions that a particular identifier equates to on a specific device by calling thesizeFromBannerContentSizeIdentifier:
class method.
However, these methods are all marked in the documentation as deprecated since iOS 6:
Deprecation Statement: Banner views no longer use content size identifiers. See Content Size Identifiers for details.
If you go to "Content Size Identifiers", nothing can be found except the documentation for these constants, all marked as depricated since iOS 6. The rest of the documentation doesn't seem to be any help either.
If these methods are deprecated, and nothing seems to have taken their place, how are you supposed to resize and get the size of iAd banners?