SlideShare a Scribd company logo
1 of 48
Download to read offline
iPhone SDK


       UIDocumentInteractionController


                Quick Look Framework



2011   1   30
iPhone SDK




           http://kishikawakatsumi.com

           Twitter
           @k_katsumi

           24/7 twenty-four seven
           http://d.hatena.ne.jp/KishikawaKatsumi/
2011   1   30
iPhone SDK



            •     touch   •MyWebClip
            •LDR touch    •
            •             •      on the WEB
            •LCD Clock    •i-Radio
            •Subway Map   •
2011   1   30
iPhone SDK

           http://github.com/kishikawakatsumi

            •hatena-touch     •DescriptionBuilder
            •ldr-touch        •TiledLayerView
            •tv-listings      •UICCalendarPicker
            •MapKit-Route-Directions
            •FlipCardNavigationView
            •PhotoFlipCardView
2011   1   30
iPhone SDK




2011   1   30
iPhone SDK


       UIDocumentInteractionController


                Quick Look Framework



2011   1   30
iPhone SDK


  •
  •
  •
  •Quick Look




2011   1   30
iPhone SDK




                             Open in "iBooks"




2011   1   30
iPhone SDK Documents
                 Interacting with




2011   1   30
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.pdf




2011   1   30
iPhone SDK


                               Sample Code

   DocInteraction
   http://developer.apple.com/library/ios/#samplecode/DocInteraction/Introduction/Intro.html




2011   1   30
iPhone SDK



                      DEMO




2011   1   30
iPhone SDK


       UIDocumentInteractionController




2011   1   30
iPhone SDK

       UIDocumentInteractionController


   + interactionControllerWithURL:




2011   1   30
iPhone SDK

       UIDocumentInteractionController


   NSURL *URL


   NSString *name
   NSString *UTI

2011   1   30
iPhone SDK



                    UI




2011   1   30
iPhone SDK

       UIDocumentInteractionController

  *readonly
  NSArray *icons




2011   1   30
iPhone SDK




2011   1   30
iPhone SDK


- (void)setupDocumentControllerWithURL:(NSURL *)url {
    self.docInteractionController =
     [UIDocumentInteractionController
      interactionControllerWithURL:url];
    self.docInteractionController.delegate = self;
}




2011   1   30
iPhone SDK
NSURL *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
iPhone SDK




2011   1   30
iPhone SDK

  UIDocumentInteractionController
  •presentPreviewAnimated:
  •dismissPreviewAnimated:

  Quick Look Framework




2011   1   30
iPhone SDK

[self.docInteractionController presentPreviewAnimated:YES];




#pragma mark -
#pragma mark UIDocumentInteractionControllerDelegate

- (UIViewController *)documentInteractionControllerViewControllerForPreview:
(UIDocumentInteractionController *)interactionController
{
    return self;
}




2011   1   30
iPhone SDK


       Quick Look Framework




2011   1   30
iPhone SDK
QLPreviewController *previewController =
 [[QLPreviewController alloc] init];
previewController.dataSource = self;
previewController.delegate = self;

previewController.currentPreviewItemIndex =
 indexPath.row;

[self
 presentModalViewController:previewController
                   animated:YES];
[previewController release];




2011   1   30
#pragma mark -  iPhone SDK
#pragma mark QLPreviewControllerDataSource

// Returns the number of items that the preview controller should
preview
- (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
// returns the item that the preview controller should preview

                iPhone SDK
- (id)previewController:(QLPreviewController *)previewController
     previewItemAtIndex:(NSInteger)index
{
    NSURL *fileURL = nil;

    NSIndexPath *selectedIndexPath = [self.tableView
indexPathForSelectedRow];
    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
iPhone SDK

                Quick Look Framework


  •

  •



2011   1   30
iPhone SDK


                Quick Look Framework




2011   1   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
iPhone SDK

  UIDocumentInteractionController
  •presentPreviewAnimated:
  •dismissPreviewAnimated:

  Quick Look Framework




2011   1   30
iPhone SDK




2011   1   30
iPhone SDK

       UIDocumentInteractionController


  •presentOptionsMenuFromRect: inView: animated:
  •presentOptionsMenuFromBarButtonItem: animated:
  •dismissMenuAnimated:



2011   1   30
iPhone SDK




                             Open in "iBooks"




2011   1   30
iPhone SDK




2011   1   30
iPhone SDK

       UIDocumentInteractionController


  •presentOpenInMenuFromRect: inView: animated:
  •presentOpenInMenuFromBarButtonItem: animated:
  •dismissMenuAnimated:



2011   1   30
iPhone SDK Documents
                 Interacting with




2011   1   30
iPhone SDK
NSURL *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
iPhone SDK




2011   1   30
iPhone SDK




2011   1   30
<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
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</string>
  </array>




2011   1   30
iPhone SDK


  <key>LSHandlerRank</key>
  <string>owner</string>




2011   1   30
iPhone SDK




2011   1   30
iPhone SDK




2011   1   30
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

More Related Content

Similar to UIDocumentInteractionController

LEARNING  iPAD STORYBOARDS IN OBJ-­‐C LESSON 1
LEARNING	 iPAD STORYBOARDS IN OBJ-­‐C LESSON 1LEARNING	 iPAD STORYBOARDS IN OBJ-­‐C LESSON 1
LEARNING  iPAD STORYBOARDS IN OBJ-­‐C LESSON 1Rich Helton
 
Bachelor Thesis-Peter Gerhat
Bachelor Thesis-Peter GerhatBachelor Thesis-Peter Gerhat
Bachelor Thesis-Peter GerhatPeter Gerhat
 
TiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy OverviewTiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy OverviewJamil Spain
 
iOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomeriOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomerAndri Yadi
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS DevelopmentJussi Pohjolainen
 
Coding - iPhone Frameworks for Museum Tours
Coding - iPhone Frameworks for Museum ToursCoding - iPhone Frameworks for Museum Tours
Coding - iPhone Frameworks for Museum ToursChris Alexander
 
Beginning Real World iOS App Development
Beginning Real World iOS App DevelopmentBeginning Real World iOS App Development
Beginning Real World iOS App DevelopmentAndri Yadi
 
SplunkLive! Developer Session
SplunkLive! Developer SessionSplunkLive! Developer Session
SplunkLive! Developer SessionSplunk
 
EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices MaoYang Chien
 
iOS 11からのアプリ間ファイル共有
iOS 11からのアプリ間ファイル共有iOS 11からのアプリ間ファイル共有
iOS 11からのアプリ間ファイル共有Kenji Tanaka
 
Developing Interactive systems - lesson 2
Developing Interactive systems - lesson 2Developing Interactive systems - lesson 2
Developing Interactive systems - lesson 2Sónia
 
Intel XDK in Brief
Intel XDK in BriefIntel XDK in Brief
Intel XDK in BriefCamilo Corea
 
打造你的第一個iPhone APP
打造你的第一個iPhone APP打造你的第一個iPhone APP
打造你的第一個iPhone APP彼得潘 Pan
 

Similar to UIDocumentInteractionController (20)

200910 - iPhone at OOPSLA
200910 - iPhone at OOPSLA200910 - iPhone at OOPSLA
200910 - iPhone at OOPSLA
 
iphone presentation
iphone presentationiphone presentation
iphone presentation
 
LEARNING  iPAD STORYBOARDS IN OBJ-­‐C LESSON 1
LEARNING	 iPAD STORYBOARDS IN OBJ-­‐C LESSON 1LEARNING	 iPAD STORYBOARDS IN OBJ-­‐C LESSON 1
LEARNING  iPAD STORYBOARDS IN OBJ-­‐C LESSON 1
 
ios basics
ios basicsios basics
ios basics
 
Bachelor Thesis-Peter Gerhat
Bachelor Thesis-Peter GerhatBachelor Thesis-Peter Gerhat
Bachelor Thesis-Peter Gerhat
 
TiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy OverviewTiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy Overview
 
iOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomeriOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for Jasakomer
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
 
Coding - iPhone Frameworks for Museum Tours
Coding - iPhone Frameworks for Museum ToursCoding - iPhone Frameworks for Museum Tours
Coding - iPhone Frameworks for Museum Tours
 
Beginning Real World iOS App Development
Beginning Real World iOS App DevelopmentBeginning Real World iOS App Development
Beginning Real World iOS App Development
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
SplunkLive! Developer Session
SplunkLive! Developer SessionSplunkLive! Developer Session
SplunkLive! Developer Session
 
iOS
iOSiOS
iOS
 
EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices
 
iOS 11からのアプリ間ファイル共有
iOS 11からのアプリ間ファイル共有iOS 11からのアプリ間ファイル共有
iOS 11からのアプリ間ファイル共有
 
XCode8.0
XCode8.0XCode8.0
XCode8.0
 
Developing Interactive systems - lesson 2
Developing Interactive systems - lesson 2Developing Interactive systems - lesson 2
Developing Interactive systems - lesson 2
 
Intel XDK in Brief
Intel XDK in BriefIntel XDK in Brief
Intel XDK in Brief
 
打造你的第一個iPhone APP
打造你的第一個iPhone APP打造你的第一個iPhone APP
打造你的第一個iPhone APP
 

Recently uploaded

Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreelreely ones
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 

Recently uploaded (20)

Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 

UIDocumentInteractionController

  • 1. iPhone SDK UIDocumentInteractionController Quick Look Framework 2011 1 30
  • 2. iPhone SDK http://kishikawakatsumi.com Twitter @k_katsumi 24/7 twenty-four seven http://d.hatena.ne.jp/KishikawaKatsumi/ 2011 1 30
  • 3. iPhone SDK • touch •MyWebClip •LDR touch • • • on the WEB •LCD Clock •i-Radio •Subway Map • 2011 1 30
  • 4. iPhone SDK http://github.com/kishikawakatsumi •hatena-touch •DescriptionBuilder •ldr-touch •TiledLayerView •tv-listings •UICCalendarPicker •MapKit-Route-Directions •FlipCardNavigationView •PhotoFlipCardView 2011 1 30
  • 6. iPhone SDK UIDocumentInteractionController Quick Look Framework 2011 1 30
  • 7. iPhone SDK • • • •Quick Look 2011 1 30
  • 8. iPhone SDK Open in "iBooks" 2011 1 30
  • 9. iPhone SDK Documents Interacting with 2011 1 30
  • 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.pdf 2011 1 30
  • 11. iPhone SDK Sample Code DocInteraction http://developer.apple.com/library/ios/#samplecode/DocInteraction/Introduction/Intro.html 2011 1 30
  • 12. iPhone SDK DEMO 2011 1 30
  • 13. iPhone SDK UIDocumentInteractionController 2011 1 30
  • 14. iPhone SDK UIDocumentInteractionController + interactionControllerWithURL: 2011 1 30
  • 15. iPhone SDK UIDocumentInteractionController NSURL *URL NSString *name NSString *UTI 2011 1 30
  • 16. iPhone SDK UI 2011 1 30
  • 17. iPhone SDK UIDocumentInteractionController *readonly NSArray *icons 2011 1 30
  • 19. iPhone SDK - (void)setupDocumentControllerWithURL:(NSURL *)url { self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url]; self.docInteractionController.delegate = self; } 2011 1 30
  • 20. iPhone SDK NSURL *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
  • 22. iPhone SDK UIDocumentInteractionController •presentPreviewAnimated: •dismissPreviewAnimated: Quick Look Framework 2011 1 30
  • 23. iPhone SDK [self.docInteractionController presentPreviewAnimated:YES]; #pragma mark - #pragma mark UIDocumentInteractionControllerDelegate - (UIViewController *)documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *)interactionController { return self; } 2011 1 30
  • 24. iPhone SDK Quick Look Framework 2011 1 30
  • 25. iPhone SDK QLPreviewController *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. #pragma mark - iPhone SDK #pragma mark QLPreviewControllerDataSource // Returns the number of items that the preview controller should preview - (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. // returns the item that the preview controller should preview iPhone SDK - (id)previewController:(QLPreviewController *)previewController previewItemAtIndex:(NSInteger)index { NSURL *fileURL = nil; NSIndexPath *selectedIndexPath = [self.tableView indexPathForSelectedRow]; 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. iPhone SDK Quick Look Framework • • 2011 1 30
  • 29. iPhone SDK Quick Look Framework 2011 1 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. iPhone SDK UIDocumentInteractionController •presentPreviewAnimated: •dismissPreviewAnimated: Quick Look Framework 2011 1 30
  • 33. iPhone SDK UIDocumentInteractionController •presentOptionsMenuFromRect: inView: animated: •presentOptionsMenuFromBarButtonItem: animated: •dismissMenuAnimated: 2011 1 30
  • 34. iPhone SDK Open in "iBooks" 2011 1 30
  • 36. iPhone SDK UIDocumentInteractionController •presentOpenInMenuFromRect: inView: animated: •presentOpenInMenuFromBarButtonItem: animated: •dismissMenuAnimated: 2011 1 30
  • 37. iPhone SDK Documents Interacting with 2011 1 30
  • 38. iPhone SDK NSURL *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
  • 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. iPhone SDK <key>CFBundleTypeName</key> <string>PDF File Format</string> 2011 1 30
  • 43. iPhone SDK <key>LSItemContentTypes</key> <array> <string>com.adobe.pdf</string> </array> 2011 1 30
  • 44. iPhone SDK <key>CFBundleTypeIconFiles</key> <array> <string>ika_twitter_01.gif</string> <string>ika_twitter_13.gif</string> </array> 2011 1 30
  • 45. iPhone SDK <key>LSHandlerRank</key> <string>owner</string> 2011 1 30
  • 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