uiactivityviewcontroller

Can I use UIActivityViewController to share on Facebook ?

大兔子大兔子 提交于 2019-12-18 16:54:59
问题 I am trying to use UIActivityViewController to share on facebook. When I am using the UIImage* image = [UIImage imageNamed:@"image1.png"]; NSArray* dataToShare = @[@"test",image]; UIActivityViewController* activityViewController = [[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil]; activityViewController.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll]; I

UIActivityViewController share only text

梦想与她 提交于 2019-12-18 16:31:34
问题 I want to share just simple text using UIActivityViewController I am using swift, with xcode 6.3 The code is very simple, work great for photos, but not just text, I don't want to include any web URL with the objectsToShare, just clean text Here is the code: var objectsToShare: ["some text to share"]! let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil) //handler for completed task activityVC.completionHandler = {(activityType, completed:Bool)

Modal status bar and navigation bar text colors from UIActivityViewControllers in iOS 7

安稳与你 提交于 2019-12-18 14:49:32
问题 When I'm using a UIActivityViewController , after the user chooses an activity (such as Mail or Message), I can not change the text color for the status bar nor the text/tint color of the Cancel and Send navigation bar buttons. For the bar buttons, in the AppDelegate I've tried using: [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; And nothing happens. However I am able to set the navigation bar title with this: [[UINavigationBar appearance] setTitleTextAttributes:

Present UIActivityViewController- LaunchServices:invalidationHandler called

我的未来我决定 提交于 2019-12-18 12:33:25
问题 I've already looked at related questions here and here, and I have implemented the suggested answers to no avail. I have a UIBarButtonItem on a UIToolbar, with Connection for Send Action to btnTBAction_touch: In the ViewController's class header I have: @property (nonatomic, strong) UIActivityViewController *activityViewController; The related method in the class implementation: - (IBAction)btnTBAction_touch:(id)sender { NSString *string = @"Some string"; NSURL *url = [[NSURL alloc]

IOS 8 iPad App Crashes When UIActivityViewController Is Called

江枫思渺然 提交于 2019-12-18 06:07:00
问题 When a UIActivityViewController is called on the iPhone in this app, it works perfectly, but when called on a iPad, the app crashes. Below is the code I used: func shareButtonPress() { //when the share button is pressed, default share phrase is added, cropped image of highscore is added var sharingItems = [AnyObject]() var shareButtonHighscore = NSUserDefaults.standardUserDefaults().objectForKey("highscore") as Int! sharingItems.append("Just hit \(shareButtonHighscore)! Beat it! #Swath")

UIActivityViewController completionHandler how to check if activity send or not successfully?

耗尽温柔 提交于 2019-12-18 05:18:22
问题 I want to send one string via airdrop, I want to call one function when the String is received on other device successfully. I had implemented it through UIActivityViewController and I check it via completionHandler. Here is my scenario : Device A ->send a string To Device B If Device B receive have two option -> Accept or Decline I want to call one function on Device A when Device B will receive or Decline that message. Below is my implementation: UIActivityViewController

How to include an Objective-C Extension in my Swift ActivityViewController?

試著忘記壹切 提交于 2019-12-16 18:06:25
问题 I have included the 1Password extension in my Browser app by following this question. However, I already have an iOS 8 Share Sheet (ActivityViewController) on my app and would like to include the 1Password inside this share sheet inside of using it's own. My app is in Swift but the 1Password is in Objective-C. Here's the code I'm using for the ActivityViewController: @IBAction func _shareButton(sender: UIButton) { var shareContent = _searchBar.text if let myWebsite = NSURL(string: "\(

Lack of a close button on UIActivityViewController

吃可爱长大的小学妹 提交于 2019-12-14 03:55:59
问题 I am currently doing some updates for an iOS application. For the update I am going to take advantage of iOS6 capabilities. I am using a UIActivityViewController to get this done as well as some custom UIActivity activities. The main issue I am having is that there is no "Cancel" or "Close" button. The only way you can exit out of the activity view is if you either post something to a social network, or act like you are going to and then cancel. NSArray* dataToShare = [[NSArray alloc]

Using UIActivityViewController to specify file type

夙愿已清 提交于 2019-12-13 23:10:03
问题 Following up from this question, how would I go about using UIActivityViewController to specify the file type of a file I am sharing over airdrop? 回答1: Worked it out: let myFileManager = FileManager.default var activityArray = [NSURL]() activityArray.removeAll() for (i, data) in dataToShare.enumerated() { let docsurl = try! myFileManager.url(for:.documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false) let myurl = docsurl.appendingPathComponent("shareData\(i).gymProf") var

Swift 2 - Share video with UIActivityViewController

吃可爱长大的小学妹 提交于 2019-12-13 13:04:27
问题 I am trying to share a video from a URL using UIActivityViewController . If I try with an Image I have not problems. Share Image Works: let imageThump = NSURL(string: "https://example.com/image.png") let imageData = NSData(contentsOfURL: imageThump!) let objectsToShare = [comment!, imageData!] let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil) Share Video is not working. Why? let videoShare = NSURL(string: "https://example.com/video.mp4") let