2017-07-06 4 views
0

hallo das ist mein Code, den ich implementieren UIactivityViewCotroller habe, aber wenn ich mich keine E-Mails und Facebook-AppiOS: Activity funktioniert nicht auf UIactivityViewController

@IBAction func activityView(_ sender: UIButton) { 
    let text = "This is some text that I want to share." 
    let textToShare = [ text ] 
    let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil) 
    activityViewController.popoverPresentationController?.sourceView = self.view 
    activityViewController.excludedActivityTypes = [ UIActivityType.airDrop, UIActivityType.postToFacebook, UIActivityType.mail ] 
    self.present(activityViewController, animated: true, completion: nil) 
} 

klicken sehen, aber ich sehe nicht, dass dieser App was soll ich machen?

Antwort

0

die Funktion Ersetzen als

@IBAction func activityView(_ sender: UIButton) { 
    let text = "This is some text that I want to share." 
    let textToShare = [ text ] 
    let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil) 
    activityViewController.popoverPresentationController?.sourceView = self.view 
     activityViewController.excludedActivityTypes = [ UIActivityType.airDrop ] 
    self.present(activityViewController, animated: true, completion: nil) 
} 

Activity Controller folgt excludedActivityTypes bedeutet, dass Sie diese Freigabeoptionen sind ausschließlich tun zur Liste in activityController

+0

dank was genau soll ich ?? Ich habe nicht komplett verstanden – Javad

+0

@Javad Ich habe die Antwort bearbeitet. Ersetzen Sie die Funktion durch diesen Code. Wenn Sie Facebook & Mail in 'excludedActivityType' hinzufügen, wird die Aktivität Facebook & Mail nicht auflisten. – Bali

+0

Haben Sie das Problem gelöst? – Bali

Verwandte Themen