uiactivity

UIActivityViewController thinks my jpg is video when share by file URL

隐身守侯 提交于 2019-12-04 23:14:58
I have jpg files saved in the Documents directory that can be shared from a standard UIActivityViewController. All activity items (including Save Image) work as expected, but when Save Image is tapped, the following error shows in the console, despite the fact that the jpg does actually get saved to the camera roll. Is this a bug in iOS, or do I have to somehow specify that my file is a jpg (and not a video) in the file URL? 2015-07-29 06:46:58.317 AppName[4658:893408] Video /var/mobile/Containers/Data/Application/A63DF08E-21D0-435D-A0D7-84D73D632FC9/Documents/ImageStore/805/23.jpg cannot be

UIActivityViewController and UIDocumentInteractionController

ⅰ亾dé卋堺 提交于 2019-12-04 05:46:26
How do I combine a UIActivityViewController and a UIDocumentInteractionController? The Mail app and the Tumblr app seem to compine a UIActivityViewController with a UIDocumentInteractionController because their controllers also show the "Open in" buttons besides the UIActivities. How can I accomplish this? Use presentOptionsMenuFromRect:inView:animated: in UIDocumentInteractionController 来源: https://stackoverflow.com/questions/19591028/uiactivityviewcontroller-and-uidocumentinteractioncontroller

iOS 8 custom UIActivity image black background color

≡放荡痞女 提交于 2019-12-03 14:21:35
I am trying to add a custom UIActivity of type UIActivityCategoryAction to UIActivityController . But in iOS 8, all of them are appearing with a black background. Is there a way to change this? There are 3 things to note here: image background, image opaqueness, image size. iOS 7 Image background : Image background should be transparent. image opaqueness The "visible part" of the icon should be non transparent aka opaque. Note that any color information won't be preserved : image size Because the image won't be scaled by the system if too small/big , you have to provide appropriately sized

UIActivityViewController completion handler is !completed when using AirDrop

梦想的初衷 提交于 2019-12-01 06:29:33
I am using UIActivityViewController to share some text and url which works great when sending some text and a url. I currently need to use the completion handler to perform additional actions depending whether the user cancelled the UIActivityViewController or actually sent something. The completion handler ( activityViewController.completionHandler for iOS 7 is deprecated in iOS 8 which is now activityViewController setCompletionWithItemsHandler ) returns a BOOL completed value which correctly returns true when sending with email sms Facebook Twitter however when sending via Airdrop the user

How to add custom buttons to UIActivityViewController?

馋奶兔 提交于 2019-11-30 21:19:30
I am using UIActivity in ios7. It is working fine with a few lines of code. Now i want to add instagram share button to it. Is there a way to add custom buttons to the action sheet? This is how i am creating the UIActivityViewController : NSString *textToShare = self.navigationItem.title; NSArray *itemsToShare = @[textToShare, [imagesArray objectAtIndex:afImgViewer.currentImage]]; UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil]; activityVC.excludedActivityTypes = @[UIActivityTypePrint,

UIActivity activityViewController being presented modally on iPad instead of in popover

白昼怎懂夜的黑 提交于 2019-11-30 13:52:14
问题 When using a customer UIActivity subclass in iOS 6, it's possible to specify a custom view controller that will be displayed when your action is chosen from the initial UIActionViewController's view. You do this by returning a reference to a custom view controller from your UIActivity subclass's activityViewController method. According to the UIActivity class reference: activityViewController The default implementation of this method returns nil . Subclasses that provide additional UI using a

UIActivity activityViewController being presented modally on iPad instead of in popover

为君一笑 提交于 2019-11-30 08:38:23
When using a customer UIActivity subclass in iOS 6, it's possible to specify a custom view controller that will be displayed when your action is chosen from the initial UIActionViewController's view. You do this by returning a reference to a custom view controller from your UIActivity subclass's activityViewController method. According to the UIActivity class reference : activityViewController The default implementation of this method returns nil . Subclasses that provide additional UI using a view controller can override this method to return that view controller. If this method returns a

Example of how to customize UIActivityViewController share menu?

大城市里の小女人 提交于 2019-11-29 12:47:41
问题 Is there an example of how to customize UIActivityViewController share menu with my own icon and IBAction ? I have seen this... - (id)initWithActivityItems:(NSArray *)activityItems applicationActivities:(NSArray *)applicationActivities; but I have not gotten it to work yet. 回答1: You first need to subclass UIActivity . Then you need to override certain methods, including activityImage for setting the icon and performActivity for performing the action (what you call "IBAction" in your question)

Problems adding custom activity to UIActivityController

☆樱花仙子☆ 提交于 2019-11-28 10:12:05
I am trying to implement a custom activity to the standard activities (Print, Mail, FaceBook, etc.) but for now only want the standard Print (for AirPrint) and my own custom printing by a direct method. I am obviously missing something fundamental as none of the methods in my custom class ever get called. For now I only have some NSLog statement to figure out the calling sequence, and to get the framework to function. The following is my test code for the custom activity class: // PrintActivity.h #import <UIKit/UIKit.h> @interface PrintActivity : UIActivity @end And the .m #import

UIActivityViewController - Email and Twitter sharing

别来无恙 提交于 2019-11-28 03:28:43
I recently started working with UIActivity to share my app to the world, but I have few problems. First, I didn't find how to set the subject of my email. Is there any way? Second, when I set the body text of my email, there is a extra "enter" (first line of the email is blank and my text starts at the second line). Here's the code: NSMutableArray *array = [[NSMutableArray alloc] initWithObjects: @"Test", nil]; UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:array applicationActivities:nil]; And in the email, it shows that: " Test "