ios - 在performDropWith委托(delegate)回调中访问源 TableView

标签 ios swift uitableview

我使用 iOS 11 UITableViewDragDelegate/UITableViewDropDelegate 对为多个 TableView 添加了拖放功能。

有什么方法可以让我访问源表对象,以便我可以对其调用 .reloadData() 吗?

最佳答案

这部分我不清楚

Is there any way for me to get access to the source table object

但是,您可以使用属性观察器didSet在每次变量修改时重新加载tableView。

这样的东西应该有效,

var dataSrouce: [String] = [] { // your data source object. 
    didSet {
        tableView.reloadData() // reload the tableView using that data source. 
    }
}

关于ios - 在performDropWith委托(delegate)回调中访问源 TableView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55333305/

相关文章:

ios - 我们是否应该使用观察者方法来修改 IBOutlet 属性

ios - 连接到 janus 服务器总是挂起,并显示来自 janus 的挂断消息

ios - 自调整 UITableViewCell 大小

iphone - 如何在触摸时放大 uitableview 单元格图像

ios - map 注释有很多问题

ios - UISearchBar textDidChange 未触发

ios - 如果我的 JSON 未加载,显示 UIAlertView?

ios - 使用 Decodable 解析 JSON 返回空模型

ios - 如何使 UITableView 对垂直滚动不那么敏感?

macos - OS X 10.10 Yosemite - 添加菜单