2017-06-19 57 views

回答

0

名爲shouldExcludeActivityType方法只是添加到UIActivityViewController回報你想要顯示和還真對其餘項目的活動項目。

import UIKit 

class MyActivityViewController: UIActivityViewController { 

    func _shouldExcludeActivityType(activity: UIActivity) -> Bool { 
     let activityTypesToExclude = [ 
     "com.apple.mail", 
     "com.apple.iMesaage", 
     "Whatsapp bundle id" 
     ] 

     if let actType = activity.activityType() { 
      if activityTypesToExclude.contains(actType)  { 
       return false 
      } 
     } 
     return true 
    } 

} 
+0

能否詳細說明一下。 Myactivityviewcontroller根本沒有被調用 –

相關問題