Search code examples
iphoneadwhirl

AdWhirl rotation usage


Im trying to rotate the AdWhirl bannerview. The only documentation AdWhirl provides is:

6.2 Device Orientation Some ad networks including iAd will vary their ad dimensions with device orientation. If your app supports rotation you must forward orientation changes to AdWhirlView by invoking AdWhirlView.rotateToOrientation: within your UIViewController’s should/willAutorotateToInterfaceOrientation: implementation and then refit as per 6.1. If your app’s notion of orientation somehow differs from UIDevice.orientation you must also implement AdWhirlDelegate.adWhirlCurrentOrientation to return the appropriate value.

I'm trying to figure this out and so far correctly implemented the adWhirlDidReceiveAd method but I can't correctly rotate and/or resize the ad in question.


Solution

  • Set AdWhirl at the bottom of the view: here

    Make the ad static when scrolling (i.e. TableView): here

    This is how I rotate ads with AdWhirl (probably not the best solution...):

        awView.transform = CGAffineTransformIdentity;
        awView.transform = CGAffineTransformMakeRotation(degreesToRadian(-90));
        awView.bounds = CGRectMake(0.0, 0.0, 480, 320);
    

    You'll need to change the coordinates depending on your view.