uiactivityviewcontroller

Why is UIActivityViewController displaying auto constraint errors in console

老子叫甜甜 提交于 2020-06-17 05:32:21
问题 I am trying to implement the Share functionality using UIActivityViewController. Using Swift 5, Xcode 11.2.1, ios 13.2. I have used UITableViewController and in the rows's click I have called the share() method as shown below : class SettingsTableViewController: UITableViewController { var tableData = ["Share with friends"] // MARK: - Table view methods override func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func tableView(_ tableView: UITableView,

Why is UIActivityViewController displaying auto constraint errors in console

∥☆過路亽.° 提交于 2020-06-17 05:32:18
问题 I am trying to implement the Share functionality using UIActivityViewController. Using Swift 5, Xcode 11.2.1, ios 13.2. I have used UITableViewController and in the rows's click I have called the share() method as shown below : class SettingsTableViewController: UITableViewController { var tableData = ["Share with friends"] // MARK: - Table view methods override func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func tableView(_ tableView: UITableView,

Showing 'UIActivityViewController' in SwiftUI

 ̄綄美尐妖づ 提交于 2020-06-10 02:58:08
问题 I want to let the user to be able to share a Location but I don't know how to show UIActivityViewController in Swift UI 回答1: The basic implementation of UIActivityViewController in SwiftUI is import UIKit import SwiftUI struct ActivityViewController: UIViewControllerRepresentable { var activityItems: [Any] var applicationActivities: [UIActivity]? = nil func makeUIViewController(context: UIViewControllerRepresentableContext<ActivityViewController>) -> UIActivityViewController { let controller

Showing 'UIActivityViewController' in SwiftUI

天涯浪子 提交于 2020-06-10 02:57:13
问题 I want to let the user to be able to share a Location but I don't know how to show UIActivityViewController in Swift UI 回答1: The basic implementation of UIActivityViewController in SwiftUI is import UIKit import SwiftUI struct ActivityViewController: UIViewControllerRepresentable { var activityItems: [Any] var applicationActivities: [UIActivity]? = nil func makeUIViewController(context: UIViewControllerRepresentableContext<ActivityViewController>) -> UIActivityViewController { let controller

ios plugin com.apple.share.Facebook.post do not show provided text

回眸只為那壹抹淺笑 提交于 2020-01-23 16:35:55
问题 In my app I'm using the following code that allows to share an image with a text: - (IBAction)sharePressed:(id)sender { UIImage *postingImage = [UIImage imageWithContentsOfFile:self.filepath]; UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[@"Lorem ipsum", postingImage] applicationActivities:nil; [self presentViewController:activityViewController animated:YES completion:nil]; } And when posting I can see image, but can't see text.

UIActivityViewController, Unable to simultaneously satisfy constraints, on devices 8.x when compiled for iOS 7.x

人走茶凉 提交于 2020-01-13 19:17:13
问题 I have an UIActivityViewController that is shown on an UIViewController (named viewCon here) : // items contains text and/or image UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil]; activityViewController.excludedActivityTypes = @[UIActivityTypePostToWeibo, UIActivityTypeAssignToContact]; [viewCon presentViewController:activityViewController animated:YES completion:NULL]; I'm using Xcode 6.1. My app has

UIActivityViewController use items in specific actions

…衆ロ難τιáo~ 提交于 2020-01-13 03:24:06
问题 I have a UIActivityViewController and i want to make it have all the actions safari does and more. Currently i can only get mail, messages, twitter, facebook and a semi-working copy. I set the activity items array with a url. I then added a nsstring of that url and added that with the url, and everything worked good like copying worked better by copying the string and i paste it in more areas. But when having the string also, twitter and facebook added the urls into their text and include the

XCUITest and UIActivityViewController

自闭症网瘾萝莉.ら 提交于 2020-01-12 10:54:28
问题 How do you access a UIActivityViewController (share / actions sheet) in XCUITest? According to the Accessibility Inspector, t is comprised of several UICollectionViews, which makes it hard to disambiguate the sheet itself. Querying for XCUIApplication().sheets.count returns 0 when the sheet is presented. 回答1: It turns out, when using the view debugger, the sheet is accessible via a somewhat hidden accessibilityIdentifier of ActivityListView (as of Xcode 9.2). It can be accessed with:

LinkedIn & Google+ UIActivity View Controller Button?

筅森魡賤 提交于 2020-01-11 07:29:08
问题 I understand that there is a Facebook & Twitter button for the UIActivity View Controller, but I was wandering if there was a service for sharing to Google+ or LinkedIn through the UIActivityViewController? 回答1: There is not one for each available in apple provided types, but you can create your own. You can create an UIActivity class and pass it into the UIActivityViewController to handle sending data to each of the services you are looking to interactive with: DataItemProvider *dataToShare

UIActivityViewController in Swift Crashes on iPad

一世执手 提交于 2020-01-11 05:01:27
问题 I am making a share function in my game and I have the code and it works fine on iPhone but when I test it on a iPad, when I tap the share button the app crashes. I am using the following code for the share button let textToShare = "Check out this website!" if let myWebsite = NSURL(string: "http://www.apple.com/") { let objectsToShare = [textToShare, myWebsite] let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil) self.view?.window?