Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2510] iOS: createDocumentViewer (UIDocumentInteractionController) is defined but undocumented

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-01-03T15:56:42.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-29, Release 1.8.0
ComponentsiOS
Labelsn/a
Reporterwilliam (at sqlcoders)
AssigneeSabil Rahim
Created2011-04-15T03:21:35.000+0000
Updated2013-01-03T12:07:02.000+0000

Description

UIDocumentInteractionController is defined as createDocumentViewer in https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIiPadProxy.m"> https://github.com/appcelerator/titanium_mobile/blob/master/iphone/..., but is undocumented despite other methods in the same class being documented.

It would be awesome if someone could write rudimentary docs for this, as for non-objc users figuring out the js->titanium->objc stuff is kind of hard (I'm trying to figure it out from the apple docs @ http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StandardBehaviors/StandardBehaviors.html#//apple_ref/doc/uid/TP40007072-CH4-SW22"> http://developer.apple.com/library/ios/#documentation/iPhone/Concep... , but its tricky because I don't do this normally)

Comments

  1. william (at sqlcoders) 2011-04-15

    I've managed to cobble together a horrible working proof at http://pastie.org/1352776">http://pastie.org/1352776 which at least confirms that the createDocumentViewer function does work, and can launch things.

    More trawling through objc to go, but I think I can get something working now.

    I don't know if appcelerator accepts outside doc/code samples, but if I can I'll attach a proper documented example later and see if someone wants to import it.

  2. Pedro Enrique 2011-06-06

    Just a comment... Could we get some Docs on this and a working sample code? The code provided by William is not working. There is a sample code from Apple (in Obj-C) right here: http://developer.apple.com/library/ios/#samplecode/DocInteraction/Listings/ReadMe_txt.html
  3. Pedro Enrique 2011-06-07

    As per customer request, this goes along with: http://developer.appcelerator.com/question/71551/feature-req-support-for-opening-files-in-other-apps-uidocumentinteractioncontroller
  4. Anirudh Nagesh 2011-07-05

    One more customer request for this info. Associated Helpdesk Ticket: http://support-admin.appcelerator.com/display/APP-851388 Increasing the priority to High
  5. Jeff English 2011-07-11

    While not the same feature, note that we now have a QuickLook module that surfaces the iOS QuickLook API for displaying documents in a view.
  6. Stephen Tramer 2011-07-25

    Forgot to resolve issue.
  7. Eric Merriman 2011-12-06

    Sample code: must include a pdf "Example.pdf"
       //-----------example--------
       Titanium.UI.setBackgroundColor('#000');
       
       //creating the window
       var win1 = Titanium.UI.createWindow({
       title:'win 1',
       backgroundColor:'#fff'
       });
       
       //add window - navigation bar
       var modalWin = Ti.UI.createWindow();
       var navmodal = Ti.UI.iPhone.createNavigationGroup({
       window:modalWin
       });
       win1.add(navmodal);
       
       //button for the nav bar
       var b2t = Titanium.UI.createButton({
       title:'Launch'
        });
       modalWin.RightNavButton = b2t;
       
       //button for the window
       var b1t = Titanium.UI.createButton({
       title:'Launch',
       height:40,
       width:200,
       top:270
       });
       win1.add(b1t);
       
       //Setting up the documentviewer
       z = Ti.UI.iPad.createDocumentViewer({url:'Example.pdf'});
       
       //documentviewer with animation set on and a quicklook view poping up next to a view
       b1t.addEventListener('click', function(){z.show({animated:false,view:b2t});});
       
       //documentviewer with animation set off
       b2t.addEventListener('click', function(){z.show();});
       win1.open();
       
  8. Eric Merriman 2011-12-06

    Verified functioning with SDK 1.8.0.1.v20111205164258 on iPad 2 (4.3.6) and iPad 2 (4.3.5). Also verified documentation is in place.
  9. Michael Pettiford 2012-01-03

    Reopening/closing to update labels
  10. Chaim Krause 2013-01-03

    I agree with Michael Pettiford's comment - 03/Jan/12 5:56 PM. Will open new issue for iOS.

JSON Source