2017-01-19 2 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: NSIndexPath!) 

с

(action:UITableViewRowAction, indexPath: IndexPath) 

или, еще лучше, просто

(action, indexPath) 
Смежные вопросы