-1

I am working on an application for iPad. This application has some PDF files and some mp4 videos. I have a share icon on the navigation bar. When the user clicks on the share icon it shows option to email or print that particular file. I want to add both email and print facility to all the pdf files and only email facility to all videos. I need help in getting this done. Help with code would be great. Any help will be highly appreciated.

Regards

PC

Prateek Chaubey
  • 653
  • 2
  • 10
  • 24

1 Answers1

1

How to send email: How can I send mail from an iPhone application

How to print: http://cocoacoding.com/2011/05/01/airprint-tutorial/

How to create an action sheet: http://ykyuen.wordpress.com/2010/04/14/iphone-uiactionsheet-example/

Put it all together:

  1. Add an Action Sheet button to your UI.
  2. Create action sheet with options for email and printing, depending on the content.
  3. Depending on the clicked button, start sending an email or printing.
Community
  • 1
  • 1
Kenny Winker
  • 11,919
  • 7
  • 56
  • 78
  • Thanks Kenny, this seems helpful. I had to show the PDFs and videos as per their category. Thats why I had to use different classes. Some PDFs and videos in one class and some are in other classes. Also the print option is to print document on a paper if the ipad is connected to any printer, wired or wifi. Will it work fine for both the cases? Do I have to add action sheet to all the classes? I have added Share icon through code to the navigation bar in the home screen. home screen navigates to other screens. – Prateek Chaubey Oct 17 '11 at 21:26
  • The share icon should be context specific. Look at the Photos app. No share button on the list view, multi-selection share button on the grid view, and a single-item share button on the detail view. Mostly people only implement the single-item share button, but it's up to you. In the method triggered by your share button you should determine if printing is available, and only show the option if it is. Look into the print API, but I don't think you have anything special to do with wired vs. wifi. – Kenny Winker Oct 17 '11 at 21:34
  • Hello Kenny, I applied the UIActionSheet to the share button with Email and print. In my project there are several classes. I have declare the Share button on the navigation bar of the Home screen through code. I made one application sheet and applied it to the share button. I did this in the home screen as well. The share button is shown on all the screens. But when I click on the share button in the screen other than home, the application crashes. It is working nicely on the home screen but crashed the app in other screens.. – Prateek Chaubey Oct 19 '11 at 18:25
  • @PrateekChaubey you're going to have to make a new question about this crash. Include info about the crash from the console, and explain your view controller structure. You're doing something wrong but I can't figure out what exactly without details. – Kenny Winker Oct 19 '11 at 23:22