uiactivityviewcontroller

Use UIActivityViewController to share all types of files

蓝咒 提交于 2020-01-11 04:12:07
问题 I want to use UIActivityViewController to share files from my iOS app. The main question for me is how do I handle different file types. What I'v got so far: Images public void OpenInExternalApp(string filepath) { if (!File.Exists(filepath)) return; UIImage uiImage = UIImage.FromFile(filepath); // Define the content to share var activityItems = new NSObject[] { uiImage }; UIActivity[] applicationActivities = null; var activityController = new UIActivityViewController(activityItems,

Compose UIActivityTypeMessage with UIImage

我怕爱的太早我们不能终老 提交于 2020-01-10 10:34:11
问题 Was wandering if anyone can offer some insight. For the life of me I can't figure out how to send a UIImage with UIActivityTypeMessage all though some say it is possible. The docs say: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIActivity_Class/Reference/Reference.html UIActivityTypeMessage The object posts the provided content to the Messages app. When using this service, you can provide NSString and NSAttributedString objects as data for the activity items. You

Scan functionality doesn't work on Action Extension(no camera opening to scan )

我的梦境 提交于 2020-01-07 02:56:06
问题 i am able to implement buttonactions,tableview,textfields ,switch... all are working fine in ActionExtension BUT Scan Functionality doesn't work (no camera opening to scan ) in Action Extension . Below i shared my scanning code in swift and screenshot of my Extension Declarations : var scannedBarcode = NSString(string: "") var scannedMetadataOutput = AVCaptureMetadataOutput() var gCaptureMetadataOutput = AVCaptureMetadataOutput() var _prevLayer = AVCaptureVideoPreviewLayer() var _session =

Correct orientation after UIActivityViewController is dismissed

▼魔方 西西 提交于 2020-01-05 00:49:23
问题 I am presenting UIActivityViewController from my controller. I've encountered issues with rotations. After some data sharing option is chosen, let's say "Mail", mail compose view controller is presented. But if I rotate the device and dismiss the mail controller afterwards, my VC is not rotated to the current orientation. I've tried to set up the completion handler for UIActivityViewController as following: 1) [activityViewController setCompletionHandler:^(NSString *activityType, BOOL

Gmail Extension crashes when sending images using UIActivityViewController

对着背影说爱祢 提交于 2020-01-04 11:08:09
问题 I use UIActivityViewController to share multiple images but when I choose a Gmail in the list, it opens it, then I see my attached files and then Gmail extension crashes. Next time it even doesn't open when I choose it. But everything works fine with Mail app or other apps in the list in UIActivityViewController. NSArray *scans = self.document.scans; NSMutableArray *imagesData = [NSMutableArray arrayWithCapacity:[scans count]]; for (DScan *scan in scans) { UIImage *image = [scan

iOS13 share sheet: how to set preview thumbnail when sharing UIImage

烂漫一生 提交于 2020-01-04 09:02:19
问题 The new share sheet on iOS13 shows a preview/thumbnail of the item being shared on its top left corner. When sharing an UIImage using an UIActivityViewController I would expect a preview/thumbnail of the image being shared to be displayed there (like e.g. when sharing an image attached to the built in Mail app), but instead the share sheet is showing my app's icon. What code/settings are required to show a thumbnail of the image being exported in the share sheet? I have set up the

presentOpenInMenuFromBarButtonItem: doesn't cause menu to appear

孤街醉人 提交于 2020-01-04 06:29:23
问题 I am attempting to display an Open In menu via UIDocumentInteractionController and presentOpenInMenuFromBarButtonItem . This does not bring up the UIDocumentInteractionController on screen. The weird thing is that if I replace " OpenIn " with " Options " then it will work as expected. What is causing presentOpenInMenuFromBarButtonItem not to work? Thank you. NSString *fileName = [NSString stringWithFormat:@"%@text.txt", NSTemporaryDirectory()]; [self.textToShare writeToFile:fileName

presentOpenInMenuFromBarButtonItem: doesn't cause menu to appear

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 06:29:16
问题 I am attempting to display an Open In menu via UIDocumentInteractionController and presentOpenInMenuFromBarButtonItem . This does not bring up the UIDocumentInteractionController on screen. The weird thing is that if I replace " OpenIn " with " Options " then it will work as expected. What is causing presentOpenInMenuFromBarButtonItem not to work? Thank you. NSString *fileName = [NSString stringWithFormat:@"%@text.txt", NSTemporaryDirectory()]; [self.textToShare writeToFile:fileName

presentOpenInMenuFromBarButtonItem: doesn't cause menu to appear

喜你入骨 提交于 2020-01-04 06:29:02
问题 I am attempting to display an Open In menu via UIDocumentInteractionController and presentOpenInMenuFromBarButtonItem . This does not bring up the UIDocumentInteractionController on screen. The weird thing is that if I replace " OpenIn " with " Options " then it will work as expected. What is causing presentOpenInMenuFromBarButtonItem not to work? Thank you. NSString *fileName = [NSString stringWithFormat:@"%@text.txt", NSTemporaryDirectory()]; [self.textToShare writeToFile:fileName

Sharing Gifs Swift

白昼怎懂夜的黑 提交于 2020-01-04 02:48:08
问题 How would I share a Gif in Swift? The method I am using right now to share the Gif URL only shares one image and does not share the animated Gif image. Here is what I have right now: var cell = self.collectionView.cellForItemAtIndexPath(index) println(index.item) var URLString: String = contentArray[index.item].contentUrlStirng var shareURL: NSURL = NSURL(string: "\(URLString)")! var shareImage: UIImage = UIImage.animatedImageWithAnimatedGIFURL(shareURL) let firstActivityItem: Array =