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

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.

Related

Browser Back Button Cause Dynamic Content to Load

I am using Wordpress, with a plugin called "Visual Portfolio" It has a feature that allows some of the content to load, then when you scroll down, it loads more portfolio thumbnail content, like an infinite scroll feature for pagination.
The problem is, this makes it so if content is loaded dynamically, when they go to a portfolio item, then press back, the content is not loaded in the same way, and they can't easily go to another portfolio item, without scrolling down again.
Is there any way to solve this, so when they press back, it loads the page the way it was when they were their before?
Thank you for your attention on this

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.

How would I go about detecting links in TTTAttributedLabel?

I have a table view and in some of the cells there are links, I want to be allow the user to click on these links and view them in a webView (which I have already made). I don't want to use the row selection event because there may be more than one link in the cell. I came across TTTAttributedLabel and think it will be ideal. I don't need to add any style to the text in the cell, I only need to detect the links and capture the click event to open up my webview.
Any help would be greatly appreciated.
It looks like you can assign a TTTAttributedLabelDelegate to a TTTAttributedLabel that will get call backs for when a user selects different link types, but no opportunity for you to capture them and open your own web view (which I think is what you're trying to accomplish).
Instead, you might wanna check out OHAttributedLabel. It's similar in functionality, but when a user clicks on one of the links in the label, it calls -(BOOL)attributedLabel:(OHAttributedLabel*)attributedLabel shouldFollowLink:(NSTextCheckingResult*)linkInfo on it's OHAttributedLabelDelegate, which gives you the opportunity to handle the link tap yourself if you return NO.

UIWebView: several pages with horizontal scrolling

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?

iPhone Footer like functionality

I am having trouble with designing my App.
I am having a button and a label in every page, required functionality is when user clicks a button, it will fetch the last tweet of application's tweeter account and will display it in label.
I know how to fetch and display it in one page.
My question is, can't I create something like custom control, which i just need to place in every page.
Hope, i was able to explain my question.
Any help will be appreciated.. thanks in advance.
Paresh
you create this footer view and place it in the first view (or a base view) and add all the subsequent views below it.. or you could even add it directly to the window..