Different data for sharing providers in UIActivityViewController

前端 未结 4 1339
忘掉有多难
忘掉有多难 2020-12-01 02:32

I\'m trying to use an UIActivityViewController with one long NSString as the data. If I put a string > 140 characters, the tweet sheet in it does n

4条回答
  •  时光说笑
    2020-12-01 02:59

    You can create a class that conforms to UIActivityItemSource and then pass its instance with an array of activity items to UIActivityViewController:, as @Mu-Sonic suggested.

    If you want to know in which platform is the user sharing and return any specific data dependent on the tapped platform, override public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any?

提交回复
热议问题