1) I load a URL in UIWebview ,which has some images .I want to enable the option,"save photo" which appears when you long-press the images in webview.Currently this option is available in Safari Browser.But I couldn't find any option in UIwebView class, And UIdataDetectorType struct dont have option for images (as of my knowledge.)
So how do I have this in my APP?
2) when I open some PDFs in webview ,I want to provide an option to open the pdf in iBooks.
How to do?
Thanks in advance.
GopiKrishnAn
I think this should be 2 separate questions.
1/ Read this blog post by iCab's author: Customize the contextual menu of UIWebView. It shows you exactly how to implement long press detection in a UIWebView.
As a bonus, his blog is a wealth of useful information about UIWebView.
2/ You need to work with UIDocumentInteractionController. As its initialization method (+ (UIDocumentInteractionController *)interactionControllerWithURL:(NSURL *)url) only works with a local URL, I guess you need to download the PDF and save it somewhere before you are able to provide such options.
Related
I've created a chat app, where user can chat and share images. Now I need to add feature where user can edit and perform some annotation on images. I've heard from iOS 9 there's a new feature called markup to perform editting on images. I've checked UIActivityViewController and couldn't find in it. Is this feature available and can it fit to my requirement? If not, is there any other alternatives that I can approach?
Yes you are Right Markup feature is available from ios 9.
iOS 9 has introduced a set of markup tools for images that you attach
with a message in the Mail app.
To use this feature,
1) Open the Mail app and compose a new message (or reply to an old one if that’s what you need to do).
2) Tap and hold on the message body area and in the floating actions bar, tap the Insert Photo or Video option. From your camera roll, insert a photo.
3) Tap and hold on the photo and in the floating actions bar that appears on the photo, tap the new ‘Markup’ option.
--> Your photo will be enter in Editing mode.
Markup tool will look like this ,
From the link whats-new you will find that apple implement markup option for mail.
So, As per your Question , Markup image facility provided bydefault by apple in Mail. so, i think you can't implement it programatically. but when user will open the mail from UIActivitycontroller from your application then user will get Markup feature with following above procedure. (But user have to manually do process to enable Markup feature)
You can also check video on youtube ,
How to markup and annotate an attachment in iOS 9
Reference link regarding markup feature,
ios-9-markup-annotate-email-attachments
I hope this info is helpful for you.
I'm new to programming and am currently working on creating a app to view PDF's for a class project.
I have added the necessary framework and files for VRF reader. I already have a slide out menu that links to different web pages and an about page. On one page I have two buttons and I want each of them to open a different PDF. I am at a loss for how to make those buttons implement the action to open a file and how to differentiate between the two pdf by which button is pressed.
I know that is a big step from where I am at to where I want to be but if anyone could help thanks in advance.
I have browsed and searched a lot for this but couldn't find any relevant answers/posts. I am looking for a framework/library with the help of which I can convert ppt slides into images and then render them on iOS device. Any other way/procedure which will display ppt page-wise with giving control on page transition will also be great.
Thanks in advance
If you just want to view the Office files, have a look at:
Document Interaction Programming Topics for iOS: Quick Look Framework.
Quick Look Framework Reference
Quick Look Framework supports a lot of file formats as you can see in the links above. It is available in iOS 4.0 and later.
You can also use UIWebView to display them. See Using UIWebView to display select document types.
I need to load or hide a part of a web page that can be viewed in my WebView.
Take a look at these two StackOverflow questions - between them, you should be able to solve your problem.
First:
Objective C - UIWebview to load only a certain part of the webpage?
Then, take a look at:
Reading HTML content from a UIWebView
I have a PDF showing in a UIDocumentInteractionController and its great.
Problem is, the point of the app is to protect the PDF from being shared etc. Hence I want to get rid of the options button that appears.
There are 1000 similar Q's on stack, but before you go linking me to what I have already read please keep in mind that I need an iOS6 solution.
I have tried implementing the willShowMenu related functions, and a bunch of other stuff.
End of the day, this needs to get onto the store, and we all know how rigid apple are, so if anyone has a solid store-aproved ios6 solution that would be great.
If not, could anyone point me in the right direction and I will work it out. Is there an alternative to UIDocumentInteractionController for display (but copy protecting) PDFs?
Thanks.
You can use UIWebView to display PDF file.
To disable copy menu, Add the following code in the webViewDidFinishLoad delegate of UIWebView
[webView stringByEvaluatingJavaScriptFromString:#"document.documentElement.style.webkitUserSelect='none';"];
[webView stringByEvaluatingJavaScriptFromString:#"document.documentElement.style.webkitTouchCallout='none';"]