IOS opens its own file in third party applications (Uidocumentinteractioncontroller)

Source: Internet
Author: User

Implement the following illustration:

Add Uidocumentinteractioncontrollerdelegate to your. h file

Then, in the. m file, create a new method that responds to pop-up Popview when you click the button, which lists other applications that open the current file.
My method is as follows

-(void) opendocumentin{

    documentcontroller = [Uidocumentinteractioncontroller interactioncontrollerwithurl:[ Nsurl Fileurlwithpath:unencodingurl]];
    Documentcontroller.delegate = self;
    Documentcontroller.uti = @ "Com.microsoft.word.doc";
    [Documentcontroller Presentopeninmenufromrect:cgrectmake (760, MB) inView:self.view Animated:yes];
}

which
"1" documentcontroller.uti that those types of files support the opening of Third-party software, which has various types of files corresponding to the parameters https://developer.apple.com/library/mac/# Documentation/miscellaneous/reference/utiref/articles/system-declareduniformtypeidentifiers.html
You can set this value dynamically according to the file suffix name in Unencodingurl
"2" rect according to their own needs to write

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.