segueを使用してテーブルビューコントローラ間でデータを転送する必要がありますか? editActionsForRowAtIndexPathメソッドで3つのアクションを書きましたが、そのうち2つが別のテーブルビューコントローラ(元のテーブルビューコントローラから削除している間)にデータを転送できることが期待されます。私が見るすべての答えがセグーについてですか?セグのないテーブルビュー間でデータを転送しますか?
誰かが私にヒントを与えることができたら、私は感謝しています、私はここにこだわっています、ちょうど私のためのヒントで十分です!
ありがとうございます。
私のコードがダウンして以下の通りです:
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let moveAction = UITableViewRowAction(style: .Default, title: "Move") { (action, indexPath) in
let moveMenu = UIAlertController(title: nil, message: "Move to", preferredStyle: .ActionSheet)
// I need to write two handler to handle the movements
let cancelationAction = UIAlertAction(title: "Move to Cancelation List", style: .Default, handler: moveToCancelation)
let achievementAction = UIAlertAction(title: "Move to Achievement List", style: .Default, handler: moveToAchievement)
let cancel = UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)
moveMenu.addAction(cancelationAction)
moveMenu.addAction(achievementAction)
moveMenu.addAction(cancel)
self.presentViewController(moveMenu, animated: true, completion: nil)
}
let deleteAction = UITableViewRowAction(style: .Default, title: "Delete") { (action, indexPath) in
// delete items from data source
self.wishList.removeAtIndex(indexPath.row)
self.saveWishList()
self.tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
}
moveAction.backgroundColor = UIColor.lightGrayColor()
deleteAction.backgroundColor = UIColor.redColor()
return [moveAction, deleteAction]
}
多分私は物事がより複雑になっています:
私の新しいコードはdownblowです。私はsegueを使用しようとします。ありがとう! –