UINavigation Controller and UIWeb View Navigation - ios

I am writing an Xcode Application that has the following structure:
UINavigationController
UITableView
Option 1 Something else
Option 2 Something else
Option 3 UIWebView
Within my web view I have an internal web page with a drill down structure:
UIWebView
Option 1
Option a
Detail from a
Option b
Detail from b
Option c
Option d
Option 2
Option 3
etc.
The navigation up to the UIWeb view is handled by iOS; the navigation once I get the UIWeb view is handled by the web page.
The problem is that I am showing the navigation bar from iOS in the first UIWebView Web page, which want to do, but not in subsequent pages.
How can I handle the handoff of navigation?

OK, I think I figured this out.
It really isn't anything to do with Xpages, but with using UIWebViews within iOS.
The problem was that on the first webView, I wanted to show the iOS Navigation, but in any subsequent ones I didn't want to - would just prefer to use the web navigation.
There is a delegation method in iOS Web views that allows you to show or hide the navigation bar. I added this delegate and just check to see which page I am on. If on the first one, I show the iOS Navigation, else I suppress.
This works great!

Related

My project has 2 navigation bar styes; default swiftui navbar and a custom one.Is there a way to hide the swiftUI navigation bar at a certain point?

I am doing a project where I am implementing the SwiftUI default navbar [navigation view and navigation link] and then I created my own custome navbar for the rest of the screens.
So, I am using the SwiftUI navbar for the login process in my application.
But after the user logs in, they are taken to the homepage. This is where I implemented my own navigationBar style.
Now you see, I linked the login button with the homepage using:
NavigationLink(destination: HomepageView())
You see where the problem is, it's like I'm nesting 2 navigation views and so I'm getting 2 navigation bars. I want to hide the default navigationBar that came from the login process.
So I tried using the [.navigationBarHidden(true)] but it does not work at all.
In short, how do I implement 2 navigation Views [one default, one custome] where I can use one for a section of my app and then the other for another section without having them to collide like this.
The best i could find was:
//added this to my HomepageView()
.navigationBarTitleDisplayMode(.inline)
.navigationBarHidden(true)
The navbar display mode changes to inline, but it is still there :)
I'm really a beginner still, so can you please help me.
Just have two UIViewControllers, one for the login and one for the home view.
So when it comes to redirecting from the login view to the home view. Do not redirect via NavigationLink because then you will end up with the same problem. (And it should not be possible if you do it properly, because your login and home views are held by their own UIViewControllers.)
Just close (viewControllerLogin.dismiss) the login view and (vieControllerHome.present) present the home screen.
If you google a bite you basically can wrap a (SwiftUI) View into a UIViewController should not be a problem. (it is quite common to do that.)
Something like that: Example

Apple Watch App - Mix approach of Page based application and Hierarchical application

Is there any way to add horizontal scrolling/pages inside Hierarchical WatchKit App. OR navigate to controllers inside Page-based application. (Hybrid approach of hierarchical and page based application)
I want to show screens in horizontal paging, however use can navigate inside further screens/controllers from any page.
As we can not push any controller in page based application, nor we can show horizontal pages in hierarchical WatchKit app. Is there any way to use hybrid approach?
My target is to show horizontal paging to user at start of application and user can navigate into hierarchy of any page.
P.S: I've implemented hierarchical and page-based applications separately, looking for some hybrid solution. One option is to make page-based application, and present a hierarchical interface modally. but there is limitation that i can not navigate further. (let's assume there are 10 pages, and in each page user can navigate upto 3 levels hierarchy)
Any suggestion would be appreciated.
Thanks.
According to WWDC 2015 Session Videos, it is not good to make such a hybrid interface.
Imagine you have a hierarchical one with two buttons. Clicking on first button opens up a view containing Page-based navigation. This will work, but if you want to scroll between pages from this page to previous one, this gesture is like returning back to Hierarchical view (scrolling from left side), so we will have a disorganization here.
In other hand, if you include buttons in a Page view controller, then user will expect to return to the only first page when returning back all the way. When he returns back to the first page, again he may thinks I must return again and so there will be another disorganization here between returning back all the way and scrolling toward the page.
If you need to implement this feature in your app, you can make a Page View navigation by dragging views to each other while pressing control key, and then add buttons. Control-drag buttons to the destination view controllers, or you can implement a hierarchical one and then control-drag the destinations together.
See WWDC 2015 session videos to get more about that. They can be found in developer.apple.com/wwdc.

Tab bar application with login view xcode 6 using storyboard?

I want to implement an application (Universal-both orientation supported) which is presenting a LoginViewController first and if login is successful, then show the tab bar controller using Xcode 6 and Storyboard. I have followed many related questions such as Adding login screen in front of Cocoa Touch Tab Bar Application for IOS and Showing login view controller before main tab bar controller which are pretty old.
This might sounds like very simple question but Im struggling to implement this feature since quite a while now.
Please provide me any sample project (or at least guidance) if anyone have done this kind of application using storyboard? And how to logout from the application when inside the tab bar controller (i.e. after logged-in) ? Hide Tab bar controller in some view controllers?

swift status bar over web page

So here's the problem, I am using WebKit, i set up a button which when clicked loads a website using NSURL. The problem is I need this website to load within the app(have that part covered) but when it does load the web page does not take the status bar in consideration. I posted a picture here with loading in just google.com (http://postimg.org/image/dncilg139/). The battery is touching the sign in portion of the website. I need a way for the web page to shift below the notification center. I need this in the new language SWIFT.
The easiest way to make this look correct is to add a UINavigationController to this scene in your storyboard. Select your UIViewController or UIWebViewController from the storyboard and from the menu select Editor->Embed In->Navigation Controller.

Display Dashcode Browser in App with SIngle NavBar

How can I display a Dashcode created Browser template in a UIWebView, that the user can dismiss, without having two navigation bars? In the photo below, you'll see that the top bar is part of an Xcode navigation controller with a back button for the purpose of letting the user leave the web view. The lower bar is for the Dashcode created stack and pop of the content hierarchy that the user navigates.
As far as I know, you can't put a button in a web page, Dashcode or otherwise, that will dismiss a cocoa app view controller. If I hide the Xcode navbar, the user can't get rid of the web view when they're done. I can't hide the Dashcode navbar or the user can't navigate the content.
As some background, what I'm trying to accomplish is in-app documentation that I host on the web. Similar to how the Apple iPhone Cards app does with its Help view. This would allow me to update the documentation via my web page, without needing to update the app itself.
The answer appears to be floating a Done button in a transparent view that floats over the top of the web view. Thereby giving the effect that the Done button (from Xcode IB) is part of the NavBar from Dashcode Browser template.

Resources