这段代码在 XCode 7.3 和 IOS 9.3 的最后一次更新之前一直运行良好,我尝试在互联网上搜索但一无所获,所以如果有人能在这里帮助我,那将是一个很大的帮助。谢谢你
我用来在 Swift 中共享文本的代码是这样的:-
let objectsToShare = [TextToShare]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
//New Excluded Activities Code
activityVC.excludedActivityTypes = [UIActivityTypeAirDrop, UIActivityTypeAddToReadingList]
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.Phone) {
self.presentViewController(activityVC, animated: true, completion: nil)
} else { //if iPad
// Change Rect to position Popover
let popoverCntlr = UIPopoverController(contentViewController: activityVC)
popoverCntlr.presentPopoverFromRect(CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/4, 0, 0), inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true)
}
控制台显示此错误:-
plugin net.whatsapp.WhatsApp.ShareExtension interrupted
plugin net.whatsapp.WhatsApp.ShareExtension invalidated
在 WhatsApp 上分享时显示: