Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
iPhone SDK       UIDocumentInteractionController                Quick Look Framework2011   1   30
iPhone SDK           http://kishikawakatsumi.com           Twitter           @k_katsumi           24/7 twenty-four seven  ...
iPhone SDK            •     touch   •MyWebClip            •LDR touch    •            •             •      on the WEB      ...
iPhone SDK           http://github.com/kishikawakatsumi            •hatena-touch     •DescriptionBuilder            •ldr-t...
iPhone SDK2011   1   30
iPhone SDK       UIDocumentInteractionController                Quick Look Framework2011   1   30
iPhone SDK  •  •  •  •Quick Look2011   1   30
iPhone SDK                             Open in "iBooks"2011   1   30
iPhone SDK Documents                 Interacting with2011   1   30
iPhone SDK                                      Documents   WWDC 2010 Session 106 - Understanding the   Document Interacti...
iPhone SDK                               Sample Code   DocInteraction   http://developer.apple.com/library/ios/#samplecode...
iPhone SDK                      DEMO2011   1   30
iPhone SDK       UIDocumentInteractionController2011   1   30
iPhone SDK       UIDocumentInteractionController   + interactionControllerWithURL:2011   1   30
iPhone SDK       UIDocumentInteractionController   NSURL *URL   NSString *name   NSString *UTI2011   1   30
iPhone SDK                    UI2011   1   30
iPhone SDK       UIDocumentInteractionController  *readonly  NSArray *icons2011   1   30
iPhone SDK2011   1   30
iPhone SDK- (void)setupDocumentControllerWithURL:(NSURL *)url {    self.docInteractionController =     [UIDocumentInteract...
iPhone SDKNSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle]                          pathForResource:document...
iPhone SDK2011   1   30
iPhone SDK  UIDocumentInteractionController  •presentPreviewAnimated:  •dismissPreviewAnimated:  Quick Look Framework2011 ...
iPhone SDK[self.docInteractionController presentPreviewAnimated:YES];#pragma mark -#pragma mark UIDocumentInteractionContr...
iPhone SDK       Quick Look Framework2011   1   30
iPhone SDKQLPreviewController *previewController = [[QLPreviewController alloc] init];previewController.dataSource = self;...
#pragma mark -  iPhone SDK#pragma mark QLPreviewControllerDataSource// Returns the number of items that the preview contro...
// returns the item that the preview controller should preview                iPhone SDK- (id)previewController:(QLPreview...
iPhone SDK                Quick Look Framework  •  •2011   1   30
iPhone SDK                Quick Look Framework2011   1   30
iPhone SDK  •iWork  •Microsoft Office   (Office 97    )  •Rich Text Format(RTF)  •PDF  •  •public.text                UTI(...
iPhone SDK  UIDocumentInteractionController  •presentPreviewAnimated:  •dismissPreviewAnimated:  Quick Look Framework2011 ...
iPhone SDK2011   1   30
iPhone SDK       UIDocumentInteractionController  •presentOptionsMenuFromRect: inView: animated:  •presentOptionsMenuFromB...
iPhone SDK                             Open in "iBooks"2011   1   30
iPhone SDK2011   1   30
iPhone SDK       UIDocumentInteractionController  •presentOpenInMenuFromRect: inView: animated:  •presentOpenInMenuFromBar...
iPhone SDK Documents                 Interacting with2011   1   30
iPhone SDKNSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle]                          pathForResource:document...
iPhone SDK2011   1   30
iPhone SDK2011   1   30
<plist version="1.0"><dict>                iPhone SDK! <key>CFBundleDocumentTypes</key>! <array>! !    <dict>! !    !   <k...
iPhone SDK  <key>CFBundleTypeName</key>  <string>PDF File Format</string>2011   1   30
iPhone SDK  <key>LSItemContentTypes</key>  <array>    <string>com.adobe.pdf</string>  </array>2011   1   30
iPhone SDK  <key>CFBundleTypeIconFiles</key>  <array>    <string>ika_twitter_01.gif</string>    <string>ika_twitter_13.gif...
iPhone SDK  <key>LSHandlerRank</key>  <string>owner</string>2011   1   30
iPhone SDK2011   1   30
iPhone SDK2011   1   30
iPhone SDK!      <key>UTExportedTypeDeclarations</key>!      <array>!      ! <dict>!      ! ! <key>UTTypeDescription</key>...
Upcoming SlideShare
Loading in …5
×

UIDocumentInteractionController

8,077 views

Published on

Published in: Technology

UIDocumentInteractionController

  1. 1. iPhone SDK UIDocumentInteractionController Quick Look Framework2011 1 30
  2. 2. iPhone SDK http://kishikawakatsumi.com Twitter @k_katsumi 24/7 twenty-four seven http://d.hatena.ne.jp/KishikawaKatsumi/2011 1 30
  3. 3. iPhone SDK • touch •MyWebClip •LDR touch • • • on the WEB •LCD Clock •i-Radio •Subway Map •2011 1 30
  4. 4. iPhone SDK http://github.com/kishikawakatsumi •hatena-touch •DescriptionBuilder •ldr-touch •TiledLayerView •tv-listings •UICCalendarPicker •MapKit-Route-Directions •FlipCardNavigationView •PhotoFlipCardView2011 1 30
  5. 5. iPhone SDK2011 1 30
  6. 6. iPhone SDK UIDocumentInteractionController Quick Look Framework2011 1 30
  7. 7. iPhone SDK • • • •Quick Look2011 1 30
  8. 8. iPhone SDK Open in "iBooks"2011 1 30
  9. 9. iPhone SDK Documents Interacting with2011 1 30
  10. 10. iPhone SDK Documents WWDC 2010 Session 106 - Understanding the Document Interaction Controller iOS http://developer.apple.com/jp/devcenter/ios/library/documentation/DocumentInteraction_TopicsForIOS.pdf Uniform Type Identifiers Reference http://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/UTIRef/UTIRef.pdf2011 1 30
  11. 11. iPhone SDK Sample Code DocInteraction http://developer.apple.com/library/ios/#samplecode/DocInteraction/Introduction/Intro.html2011 1 30
  12. 12. iPhone SDK DEMO2011 1 30
  13. 13. iPhone SDK UIDocumentInteractionController2011 1 30
  14. 14. iPhone SDK UIDocumentInteractionController + interactionControllerWithURL:2011 1 30
  15. 15. iPhone SDK UIDocumentInteractionController NSURL *URL NSString *name NSString *UTI2011 1 30
  16. 16. iPhone SDK UI2011 1 30
  17. 17. iPhone SDK UIDocumentInteractionController *readonly NSArray *icons2011 1 30
  18. 18. iPhone SDK2011 1 30
  19. 19. iPhone SDK- (void)setupDocumentControllerWithURL:(NSURL *)url { self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url]; self.docInteractionController.delegate = self;}2011 1 30
  20. 20. iPhone SDKNSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:documents[indexPath.row] ofType:nil]];[self setupDocumentControllerWithURL:fileURL];cell.textLabel.text = [[fileURL path] lastPathComponent];NSInteger iconCount = [docInteractionController.icons count];if (iconCount > 0){ cell.imageView.image = [docInteractionController.icons objectAtIndex:iconCount - 1];}2011 1 30
  21. 21. iPhone SDK2011 1 30
  22. 22. iPhone SDK UIDocumentInteractionController •presentPreviewAnimated: •dismissPreviewAnimated: Quick Look Framework2011 1 30
  23. 23. iPhone SDK[self.docInteractionController presentPreviewAnimated:YES];#pragma mark -#pragma mark UIDocumentInteractionControllerDelegate- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)interactionController{ return self;}2011 1 30
  24. 24. iPhone SDK Quick Look Framework2011 1 30
  25. 25. iPhone SDKQLPreviewController *previewController = [[QLPreviewController alloc] init];previewController.dataSource = self;previewController.delegate = self;previewController.currentPreviewItemIndex = indexPath.row;[self presentModalViewController:previewController animated:YES];[previewController release];2011 1 30
  26. 26. #pragma mark - iPhone SDK#pragma mark QLPreviewControllerDataSource// Returns the number of items that the preview controller shouldpreview- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)previewController{ NSInteger numToPreview = 0; NSIndexPath *selectedIndexPath = [self.tableView indexPathForSelectedRow]; if (selectedIndexPath.section == 0) numToPreview = NUM_DOCS; else numToPreview = self.documentURLs.count; return numToPreview;}2011 1 30
  27. 27. // returns the item that the preview controller should preview iPhone SDK- (id)previewController:(QLPreviewController *)previewController previewItemAtIndex:(NSInteger)index{ NSURL *fileURL = nil; NSIndexPath *selectedIndexPath = [self.tableViewindexPathForSelectedRow]; if (selectedIndexPath.section == 0) { fileURL = [NSURL fileURLWithPath: [[NSBundle mainBundle]pathForResource:documents[index] ofType:nil]]; } else { fileURL = [self.documentURLs objectAtIndex:index]; } return fileURL;}2011 1 30
  28. 28. iPhone SDK Quick Look Framework • •2011 1 30
  29. 29. iPhone SDK Quick Look Framework2011 1 30
  30. 30. iPhone SDK •iWork •Microsoft Office (Office 97 ) •Rich Text Format(RTF) •PDF • •public.text UTI(Uniform Type Identifier) ( Uniform Type Identifiers Reference ) • (CSV)2011 1 30
  31. 31. iPhone SDK UIDocumentInteractionController •presentPreviewAnimated: •dismissPreviewAnimated: Quick Look Framework2011 1 30
  32. 32. iPhone SDK2011 1 30
  33. 33. iPhone SDK UIDocumentInteractionController •presentOptionsMenuFromRect: inView: animated: •presentOptionsMenuFromBarButtonItem: animated: •dismissMenuAnimated:2011 1 30
  34. 34. iPhone SDK Open in "iBooks"2011 1 30
  35. 35. iPhone SDK2011 1 30
  36. 36. iPhone SDK UIDocumentInteractionController •presentOpenInMenuFromRect: inView: animated: •presentOpenInMenuFromBarButtonItem: animated: •dismissMenuAnimated:2011 1 30
  37. 37. iPhone SDK Documents Interacting with2011 1 30
  38. 38. iPhone SDKNSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:documents[indexPath.row] ofType:nil]];[self setupDocumentControllerWithURL:fileURL];cell.textLabel.text = [[fileURL path] lastPathComponent];NSInteger iconCount = [docInteractionController.icons count];if (iconCount > 0){ cell.imageView.image = [docInteractionController.icons objectAtIndex:iconCount - 1];}2011 1 30
  39. 39. iPhone SDK2011 1 30
  40. 40. iPhone SDK2011 1 30
  41. 41. <plist version="1.0"><dict> iPhone SDK! <key>CFBundleDocumentTypes</key>! <array>! ! <dict>! ! ! <key>CFBundleTypeName</key>! ! ! <string>Ika File Format</string>! ! ! <key>CFBundleTypeExtensions</key>! ! ! <array>! ! ! ! <string>ika</string>! ! ! </array>! ! ! <key>CFBundleTypeIconFiles</key>! ! ! <array>! ! ! ! <string>ika_twitter_01.gif</string>! ! ! ! <string>ika_twitter_13.gif</string>! ! ! </array>! ! ! <key>LSItemContentTypes</key>! ! ! <array>! ! ! ! <string>com.kishikawakatsumi.ika</string>! ! ! </array>! ! ! <key>LSHandlerRank</key>! ! ! <string>owner</string>! ! </dict>! ! <dict>! ! ! <key>CFBundleTypeName</key>2011 1 30
  42. 42. iPhone SDK <key>CFBundleTypeName</key> <string>PDF File Format</string>2011 1 30
  43. 43. iPhone SDK <key>LSItemContentTypes</key> <array> <string>com.adobe.pdf</string> </array>2011 1 30
  44. 44. iPhone SDK <key>CFBundleTypeIconFiles</key> <array> <string>ika_twitter_01.gif</string> <string>ika_twitter_13.gif</string> </array>2011 1 30
  45. 45. iPhone SDK <key>LSHandlerRank</key> <string>owner</string>2011 1 30
  46. 46. iPhone SDK2011 1 30
  47. 47. iPhone SDK2011 1 30
  48. 48. iPhone SDK! <key>UTExportedTypeDeclarations</key>! <array>! ! <dict>! ! ! <key>UTTypeDescription</key>! ! ! <string>Ika File Format</string>! ! ! <key>UTTypeIdentifier</key>! ! ! <string>com.kishikawakatsumi.ika</string>! ! ! <key>UTTypeTagSpecification</key>! ! ! <dict>! ! ! ! <key>public.filename-extension</key>! ! ! ! <string>ika</string>! ! ! </dict>! ! </dict>! </array>2011 1 30

×