uitableview - 在 Swift 中为 cellForRowAtIndexPath 调用 super

标签 uitableview swift

如果有人能帮助我了解调用 super 的语法以从 func tableView (tableView: UITableView!, cellForRowAtIndexPath) 中获取 UITableViewCell,我将不胜感激indexPath: NSIndexPath!)。这是一个静态表。

override func tableView (tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
//  The Objective-C code is: UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
var cell = super.??
}

我试了又试,但似乎无法获得执行此操作的正确语法。提前致谢。

最佳答案

var cell = super.tableView(tableView, cellForRowAt: indexPath)

关于uitableview - 在 Swift 中为 cellForRowAtIndexPath 调用 super,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24481440/

相关文章:

html - 如何更改和添加适用于 iOS 的 GDPRconsentform.html 文件

ios - 创建类似于 whatsapp 的消息历史记录(objective-c)

swift - 我如何从嵌入在 UITableViewCell (Swift) 中的 UICollectionView 的单元格中分离出来?

ios - 拉动时 UIRefreshControl 中的奇怪动画

ios - 如何在 tableview swift 中显示用户选择行的新 tableview

macos - 我可以用 Swift 编写一个 Spotlight 导入器吗?

ios - 从 Firebase 获取位置并将其显示在 map 上

ios - 使用 Swift 在 whatsapp 上分享图像

swift - 如何在静态 UITableviewCell 中使用 setTitleForState 更改 UIButton 标题

ios - 导入数据后如何重新加载UITableView?