2017-01-19 1 views
-3

に失敗:Xcodeのビルドが、私はエラーを得続ける

Cannot convert value of type '(UITableViewRowAction!, NSIndexPath!) -> Void' to expected argument type '(UITableViewRowAction, IndexPath) -> Void'

は、誰もが、私はこのエラーを取り除くために何ができるか知っていますか?

func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { 
    var shareAction = UITableViewRowAction(style: .normal, title: "Share") { 
     (action:UITableViewRowAction!, indexPath: NSIndexPath!) -> Void in 
      let firstActivityItem = self.animals[indexPath.row] 
      let activityViewController = UIActivityViewController(activityItems: [firstActivityItem], applicationActivities: nil) 
      self.presentviewcontroller(activityViewController, animated: true, completion: nil) 
    } 
    shareAction.backgroundColor = UIColor.blueColor() 
    return [shareAction] 
} 

答えて

0

交換単により良い

(action:UITableViewRowAction, indexPath: IndexPath) 

又は、

(action, indexPath) 

(action:UITableViewRowAction!, indexPath: NSIndexPath!) 

関連する問題