Why is ADBannerView showing navigation bar on top, in iOS 6 only - uinavigationcontroller

I have an iOS application, with iAd using ADBannerView. It works perfectly in iOS 5, showing the ad full screen when the user taps on the banner. But when I run the exact same code in iOS 6, the navigation bar and tab bar shows on top of the ad:
Note that the "X" button on the Ad behind the nav bar works as it should to close the Ad, and the navigation bar and tab bar buttons work as well.
My app has a UITabBarController as the root controller, with 4 UINavigationControllers under it. And I did call this in didFinishLaunchingWithOptions:
[self.window setRootViewController:tabBarController];
What could be wrong? I'm guessing the view hierarchy is somehow not setup correctly.
Thanks in advance for your help!

I think I found the issue. This is most likely because my UIViewController hierarchy was not properly setup, in that I didn't have a addChildViewController: call where it's needed. The When to use addChildViewController vs pushViewController thread was very helpful.
An alternative that I'd recommend now is to simply use the code in the TabbedBanner project in the Apple iAdSuite sample.

Related

SlideOutMenu remove Navigation Bar

I use SWRevealViewController for my project. Currently, the problem is that when the project starts, Navigation bar show with title of "MyApp". But, navigation bar disappears when I click on Home
If I add a Navigation Bar in view controller, there will be 2 navigation bars at first run. One navigation will automatically disappear when I click on Home link.
How to do to get the first image appearance when I click on Home link? I'm using Swift 3.
You could try set the navigation bar to not hidden in the viewWillAppear.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: false)
// ...
}
However I presume the reason the navigation bar is hidden is because the controller is being presented modally and not being pushed onto the main navigation controller. If this is the case, then you will need to probably do something with the SWRevealViewController and push the controller onto the main navigation controller.
Check out the Basic API usage for SWRevealViewController here and here is an alternative that has codeless storyboard implementation and is very easy to configure.
(Posted on behalf of the OP).
I'm not sure the way I solved is right or wrong. But, it works for me.
I remove default Navigation Bar by disabling the bar visibility. Then, I add new Navigation Bar in Home page. After I run the app, my new Navigation Bar appears when I press on the Home button.

Xcode 6 iAd Layout Issue or Bug

I have added an iAd banner view to my project and pinned it to the top of the main view controller in a storyboard. Initially when the app loads the iAd banner is displayed at the bottom of the screen. The banner is then hidden during a game and then unhidden at the end of the game. When the banner is unhidden it appears correctly as designed in the storyboard at the top of the view. Any thoughts why this is happening? This occurs on both the simulator and real devices.
You've created two ADBannerView's in your application. Once with self.canDisplayBannerAds = true and once programmatically.
self.canDisplayBannerAds = true can be used for a no hassle way of implementing iAds in your application. This will create an ADBannerView for you and show or hide the ADBannerView depending on whether it receives an ad or not from the iAd network. The ADBannerView you're seeing at the bottom of your screen is created by self.canDisplayBannerAds = true. The ADBannerView you're seeing at the top of your screen is the ADBannerView you have created.
Remove self.canDisplayBannerAds = true from your viewDidLoad function.

Swipe to go back in navigation controller on iOS 7

I've been looking through the iOS 7 / UIKIT framework, and although it looks quite different aesthetically it's really the same SDK underneath from what I can see.
My question, is there any extra code that needs to be included to get the draggable behaviour between pushed tableviews/views?
When you push a view onto a UINavigationController you can now drag back to the previous controller from the side rather than pressing the back button.
This behavior can be seen in mail.
How is this achieved, do I need to add any code to add it to my app?
This has nothing to do with UITableView or UITableViewController, but with UINavigationController. And yes, you get this behavior for free as long as the back button is visible.

UINavigationController with UITableView in modal popup (on iPad)

Short Version:
"How do you get a simple UITable drill down UINavigationController-styled non-full-screen modal dialog on the iPad?"
Long version:
I have a very specific set of requirements that I can't seem to get working...
I have a functioning iPad program that that needs to pop up a non-full-screen modal view. This modal needs to have a navigation controller and a simple drill-down table that displays a detailed view that I can have edit some values related to the selected item in the table.
Of course I am looking to have the regular "Back" and "Delete" buttons in the Navigation Bar.
I can handle the detailed view, what I am having issues with:
Non-full-screen popup (mine is
always full screen no matter what I
try).
The Navigation controller will not display the Table View I tell it to and the navigation bar does not even have the title I assigned to it in IB.
I can't seem to get any of this working. If anyone has a step by step example of how to do this, that would be great,
~Eric
P.S. I am not afraid of doing this 100% programmatically, but all the examples I have been trying to follow (and failing at extending to my problem) use IB.
As for the fullscreen issue, you need to set modalPresentationStyle to UIModalPresentationFormSheet or UIModalPresentationPageSheet on the controller you want to present modally. I'm not sure of a way to do this through IB.
As for your navigation controller/table view, I think more information is needed to provide an answer.

Problem in using tab bar controller with navigation controller

I am working on a navigation based application. I am using navigation controller for this purpose. I want to use tab bar on one of the screens and i am not able to find any way of doing this. As far as i have read, it is not possible to add tab bar controller when you are using navigation controller. Is it right? One solution was to manually add a tab bar on the screen and write its delegate class but in this solution, I will lose "More" button functionality because this thing is handled by tab bar controller itself. Does anyone has any solution to my problem? Please help!!!
You can add a UINavigationController to each of the UITabBarController's tab views but not the other way around.
According to Apple's documentation you cannot push a UITabBarController on top of the UINavigationController. I'm not sure if that is a technical limitation or if they will reject your application when you submit. Either way you shouldn't try to do this.

Resources