TabBarController

15 views
Skip to first unread message

Eric Jones

unread,
Apr 27, 2012, 3:38:41 PM4/27/12
to AdWhirl Users
Hi,

I am trying to add an Adwhirl view to the top of my current iOS
application. The application is composed of five different views,
which are all under the control of a single TabBarController. can
anyone write a brief tutorial that shows the code required to achieve
this?

Below is my current attempt at the problem, I don't get errors but I
don't see anything different on the screen. Thanks in advance.

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

AdWhirlView *adView = [AdWhirlView
requestAdWhirlViewWithDelegate:self];
[self.tabBarController.view addSubview:adView];
adView.center = CGPointMake(160, 342);
[self.tabBarController.view bringSubviewToFront:adView];

}


- (NSString *)adWhirlApplicationKey {
// return your SDK key
return kSampleAppKey;

}
- (UIViewController *)viewControllerForPresentingModalView {

//return UIWindow.viewController;
return [(idoubs2AppDelegate *)[[UIApplication sharedApplication]
delegate] tabBarController];

}
- (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlView {



}

wes

unread,
Apr 27, 2012, 5:40:36 PM4/27/12
to adwhir...@googlegroups.com
I'm assuming you're adding the tabBarController.view as a subview of the window, right?  Given that, it looks like your code should probably work, but only for the very first selected tab.  You might need to use [self.tabBarController.view insertSubview:adView atIndex:0] to get it right, however.

Cheers,
Wes
Reply all
Reply to author
Forward
0 new messages