UIWebView: several pages with horizontal scrolling - iphone

I am having a difficult time finding any information on this and I think it's because I am looking at this all wrong.
I am trying to create a UIWebView that has several webviews within it. The way I picture this is a UIPageController with dynamic pages being loaded or a scroll view that has dynamic UIWebViews in it so that the user can guesture left or right for "next page" and "back" operations with a nice scroll like animation to the next webview page. The problem is I can't seem to find any information on how to set this up properly and in xCode 4.2. The other part of the problem is that the number of pages is never known to the app but I can find out if there is a "next page" (currently by using javascript in the UIWebView and passing the new url to [webView loadRequest:]). Can someone point me it the right direction?

Related

Swift: How to navigate to a PDF page after clicking TableViewCell from another VC

I am building an app, where i have loaded a PDF of 300 pages. This PDF has lot of content, which are added as keywords to the tableViewCell in another VC.
When i tap any cell from VC, it should navigate to the next VC, where i have a UIWebView which has the PDF.
Now the ask is, when i press this cell, the new VC directly should navigate to the given page where the information related to that keyword is present.
Any idea or points on how to show a given page in PDF will help.
Thanks.
Because you're dealing with web, it is hard to have native navigation. I know from web development experience that to navigate to a specific part of a website, you can use anchor points/tags. I'd recommend looking into those. With them, you can change the URL from somepagehere.com to somepagehere.com/#page-1 or somepagepagehere.com/#-2, etc. Then, with the the UITableView you can point directly to these anchor points.
Let me know if this helps!
From your questions, it seems like you have a 300 page PDF file from an online location and you gather all the menu in your table view and each cell has the same url pointing to the link of the PDF.
This is not a good practice on the first place. This means that you are reloading the PDF file again and again when user simply want to see contents from another menu. It's also extremely hard to deal with paging problem from a web view.
Instead, if your pdf is well formatted(meaning it has a menu page and when you click on them from Adobe PDF reader, it can jump to the page), simply use this PDF reader. It also provides you the menu by itself and you don't need to have a table view controller and a webview controller. Moreover, you just need to put PDF file in your main bundle and never need to download every time.

From modal to off canvas?

I've just started on a new project of my own.
What I would like to do is, on large screens, having a button activating a modal window BUT, on smaller screen (mobiles), I would like that modal window to become an off canvas section and when the button is clicked, the off canvas slides in from the side. Within that modal/off canvas part, there will be a form to fill out. (there will actually be multiple buttons that will need to activate the feature. Think something like multiple thumbnails with each a button to let viewers add comments)
I'm using Bootstrap 3 as my base framework. I would like to minimise the javascript (jQuery) functionalities but I understand I can't completely.
Questions I have,
do I have to create two HTML sections, one for the modal and one for the off canvas and then programatically hide/show according screen size?
Would it be best to create the form and then thru javascript, add the proper HTML around it according screen size? (though I think this option would be a tough to implement as my javascript skills are "advance beginner" at best)
How would I make the same button switch activation of the modal window or the off canvas form?
It seems to me that I need to detect screen size, no matter how I do the above, what would be the best way to detect the screen size, the safest and surest way?
Thanks for any insights you guys might have on this.
You will have to show code in your questions here, so i also vote to close your question.
I'm using Bootstrap 3 as my base framework. I would like to minimise
the javascript (jQuery) functionalities but I understand I can't
completely.
Angular JS decouples Twitter's Bootstrap from javascript. See: http://angular-ui.github.io/bootstrap/
Questions I have, do I have to create two HTML sections, one for the
modal and one for the off canvas and then programatically hide/show
according screen size?
Take a look to the Responsive Utilities: http://getbootstrap.com/css/#responsive-utilities
The screen detection of Twitter's Bootstrap is based on CSS media queries.
How would I make the same button switch activation of the modal window or the off canvas >form?
To give the same button different function based on sceensize you will need javascript / jQuery. See: Get the size of the screen, current web page and browser window you also could consider to use something like enquire.js, see also http://bassjobsen.weblogs.fm/responsive-banner-ads-2/
Or create two buttons and hide / show them with the the Responsive Utilities.

How to show pages index in side when showing the pdf in uiwebview

In the above image, we can see the navigationbar and pages index(side) which can viewed when the user tapped the screen once and will be removed from superview, on another tap.
I added the navigationbar using tap gesture recogniser, but to show the pages index I didn't know what to do and even how to search in google?
Any help will be appreciated.
Since you have added the uiwebviewtag to your question, I guess you are using a uiwebview to read the pdf.
In this case, there is no way to add a sidebar with the page index.
The only way do it is to develop your own viewer using Quartz, or to use an existing library.

iPhone: Is there any way of how to PDF pages Scroll In UIScrollview like paging in Leaves Project

I have a Leaves view (Tom Brow's leaves project) to simulate curling effect for PDF pages.
now i want to implement in Leaves project page only scrolling like paging i was refund vfr-Reader project but it is hard coding and i can not understood how to implements in Leaves project.
please can anyone guide me how to do this stuff in Leaves project PDF page scroll paging (not curl)

Ways of showing a webpage in iPhone?

I have a UIwebview which loads up a page ,first the links in the page were opening up on the same page, that made it look ugly, then I found a function which made the link open up in the phone's safari browser.That was nice but actually I want to show the links in a pop up view which can simply be closed. I have seen the google map popping up and showing the map. I want to do the same same thing with the links on the page they should open up as pop up and should not open up in safari and neither in the same UIWebview.
What could be the possible way to implement this.
Another inspiration is phonegap's ChildBrowser which opens the link as a popup.
I want to implement the same in native.
Any help and suggestions will be appreciated.
You have to use UIWebview to show the web content for the link. just resize it by using frame property as per your requirement because it's inherited by UIView.