我有一个与我的viewController
相关联的UITable,其中包含DataSource
和Delegate
的附加信息。但是,当我查看我的视图控制器上的连接时,它们没有链接,我无法确定如何链接它们,任何帮助表示赞赏。
IBOutlet中
@IBOutlet weak var locationTableView: UITableView!
当前代码 扩展findCacheViewController:UITableViewDataSource {
//Number Of Rows (Return Value)
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return cacheData.count
}
//Table Content
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = locationTableView.dequeueReusableCellWithIdentifier("Cell")
let cellData = cacheData[indexPath.row]
let titleLabelCell = cell?.viewWithTag(1) as! UILabel
let typeLabelCell = cell?.viewWithTag(2) as! UILabel
let distanceLabelCell = cell?.viewWithTag(3) as! UILabel
if userCurrentLocation == nil {
titleLabelCell.text = "Location Required"
typeLabelCell.text = ""
distanceLabelCell.text = ""
} else {
titleLabelCell.text = "\(cellData.memoryTitle)"
typeLabelCell.text = "\(cellData.memoryType)"
}
return cell!
}
}
扩展名findCacheViewController:UITableViewDelegate {
//Row Height Based On Condition
//func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
//let cellData = cachedata[indexPath.row]
//if conditions {
//}
//}
//Selected Cell Segue Function
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
selectedCell = cacheData[indexPath.row]
//performSegueWithIdentifier(<#T##identifier: String##String#>, sender: self)
}
}