I want to manage multiple page or tabs in UIWebView like default iPhone Safari See Screen shot for better understand :
http://s14.postimg.org/xie4imi35/i_OS_Simulator_Screen_shot_24_May_2014_7_56_03_PM.png
Is that possible to manage this in UIWebView.
Three things I want to tell you here:
See Answer for multi tab in UIWebView here.
Look at HGPageScrollView library and WKPagesCollectionView on Github.
I saw that in UINavigationController when we move from ParentViewController to ChildViewController and then move back again state of Parent view is maintained. I am trying to use that in implementing multi tabs in UIWebView.
Related
my designer created this layout:
How can I mimic that on iOS? I tried creating a Segmented Control but didn't work well because it can't be customized after iOS7. So at the moment I'm thinking about a UIPageControl with custom dots like explained here: Customize dot with image of UIPageControl at index 0 of UIPageControl
My problem is also with the concept. Segmented controls are said to be used to flatten/filter results according to iOS human guidelines while UIPageControl has actually different pages...
Is this the best approach? If so, can I make it look like the Android Tab bar?
Segmented control with custom image
UIPageControl with custom image
UITabBar on top (read too many bad things about this approach)
something else
If UIPageControl is indeed the best/correct/possible approach how can I make it look as close as the image? And also move it to the top?
Thanks!
Short answer: Don't do that. You're trying to implement Android controls on iOS. That leads to user confusion and an app that doesn't feel like a native app.
Instead, have your designer create a native app design for both platforms.
It looks to me like the closest analog to what you're trying to do is a tab bar and a tab bar controller (UITabBarController).
EDIT:
If you must implement this UI on iOS, you might have to roll your own. You'd create a new custom parent view controller with a child view controller that you could swap out, and a custom control that triggers the swapping. Conceptually it would be a lot like a tab bar controller.
You could probably set it up using a container view and an embed segue (The embedded view controller would be the starting child view controller) and then use the built-in support for managing child view controllers to swap out the child view controller when the user taps on your control. I've done this sort of thing before. It isn't that hard, and is pretty well documented.
How to achive facebook kind of SSO in iphone sdk?
(The way they open a view for login and loading).
I Don't want to use UIViewController and want to show Login/Loading view
and want to put Login/Loading code at one place
as that view is going to be opened from lots of controllers.
Is there any way to achieve this? (protocol?)
Not sure if this is what you mean, but the following tutorial shows a handy mechanism for allowing you to design a popup overlay window using a UIViewController.
http://blog.typpz.com/2013/12/09/ios-sdk-create-a-pop-up-window/
You design a UIViewController in storyboard which contains your overlay popup view. The surroundings remain transparent. You can create an instance of this UIViewController in your code and then ask it to overlay its view onto your existing controller view. The result is a popup window similar to a UIAlertView, into which you can put whatever you wish.
I use this for doing popup help overlays, but I image you could easily use it for your facebook like content.
Benefit 1) Since you design it in a UIViewController, you can use all the size class related layout and you can see how it will look on all the different device types.
Benefit 2) It is totally reusable. From any controller, create an overlay UIViewController instance and ask it to overlay its content on your current controller. Reverse is to ask it to remove the overlay.
Looking all over for a simple Xcode project that will load my web site in a UIWebView that has the default Safari controllers for back / refresh the page - but can't seem to find one.
All I could find was a great template project, but it didn't have the controllers. And since I am very new to iOS development, I can't figure out how to add the controllers.
Can anyone help me out with complete source for something like that?
Thanks
Add a navigationbar above or a toolbar under the webview
Put two barbuttonitems/buttons into the bar, one for back and one for forward. Of course you can also use the segmented control
Set the webview's delegate to the view controller of the view
In the TouchDown-actions of the buttons, call webView's goBack: or goForward: methods
For the method references, see here: https://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instm/UIWebView/goBack
The same can of course be done with reload (the method is called refresh), and this SO even shows an example of how to do it:
Refresh a UIWebView
Should I make UIWebViews for every tab or should they share one and the tab selection just changes the URL?
What's better?
If the later, how do I do that?
Thanks!
The answer really depends on whether you want the ability to go back and forth easily. For example, if on tab A I have webPage1 and on tab B I have webPage2, as a user when I go back to tab A I don't really expect to have to reload the page. So, I would suggest a separate webView for each tab in order to maintain separate content. There is very little overhead in maintaining a couple web views, anyway.
This can also be done without UITabBarController, using a UIPageControl along the bottom of a normal UIViewController. You can make it a little taller and the user can touch on it to navigate. This is important since once UIWebView loads it will grab left and right swipes, making it difficult to swipe left/right to change views. A nice advantage here is that the user can add another webview (if you allow it) and the UIPageControl will support it more smoothly than will a UITabBarController.
Another option is the UIPageViewController, which I haven't yet used but looks similar to what you describe.
Good luck,
Damien
The Flow of my application is
Application Starts -> TopMenuViewController ( Which Contains Several Buttons & navigation controller ) -> When particular button is clicked -> Load Split View Controller.
The user can go back to TopViewController. In short I want to load UISplitViewController on button click. How to do this? Thanx in advance.
In my experience, there's no good way to load a UISplitViewController on demand like that. It has to be the root of your entire user interface, or you will pull your hair out trying to make things work.
I've reworked several app designs to fit into this requirement, and it's generally not been difficult at all to come up with something functional and attractive which fits into the split-view-at-all-times paradigm. You can freely swap the views loaded into each side of the split with login panels, empty placeholders, etc. to make your flow work with the splitview.
There are third-party split view controllers that mimic Apple's and allow later loading (as well as master pane visibility in portrait, and other features). One is Matt Gemmell's MGSplitViewController. You could also come up with a different presentation altogether for your master-detail hierarchy.