I'm working on an application in which I am implementing the iAd framework.
Base SDK version is iOS 7.
Initially, I began by placing AdBannerView
objects at the bottom of the screen where I wanted them. Because of the way I implement my view hierarchy, I discovered that rotation was an issue, so I ended up having to set IBOutlet
s to NSLayoutConstraint
s to get the correct height when rotating. As I ended up having to hard-code values, this felt like I hack, so I went looking for other solutions.
I came across documentation for the brand new UIViewController
addition canDisplayBannerAds
. It seemed like a silver bullet! Simply set the property to YES
and you're done!
And actually, it works quite well and almost perfectly. The only issue I have is the following:
- When the
UIViewController
loads, no iAd is visible. - Apparently, the framework is checking in the background to see if it can get an ad and, if so, loads the ad.
- Once it has the ad, it animates adding the ad to the bottom of the screen. This involves re-wrapping the
UIViewController
'sview
into a property calledoriginalContentView
. Ok. So far so good. It's a little bit annoying, but I'm still getting a lot of work "for free".
The problem I'm having is that my view is unresponsive while this animation takes place. Since I have set this property to YES
is my most-frequented UIViewController
s, this means that a good bit of my app has a "glitch" that will be very apparent to a user who is trying to use the ad in any kind of a quick way.
Now, I haven't done extensive testing on this yet, and my Google-Fu has failed to turn up anything on this issue (except for one oblique comment on another StackOverflow question), so I may be mistaken about what I'm seeing, but I think this is how it is working.
It seems to me, though, that this can't possibly be the desired behavior. Making one aspect of implementing iAds easier shouldn't essentially break another part of your app, right?