ViewController
에 사용자 정의 UITableView
이 있습니다. 내 사용자 정의 표에는 사용자 정의 UITableViewCells
이 있습니다.UITableView didSelectRowAt가 등록되지 않았습니다.
ViewDidLoad
:
self.firstListTable.dataSource = self
self.firstListTable.delegate = self
self.firstListTable.register(UINib(nibName: "firstQueueCell", bundle: Bundle.main), forCellReuseIdentifier: "firstCell")
self.searchListTable.dataSource = self
self.searchListTable.delegate = self
self.searchListTable.allowsSelection = true
self.searchListTable.register(UINib(nibName: "SearchCell", bundle: Bundle.main), forCellReuseIdentifier: "SearchCell")
self.searchListTable.separatorStyle = .none
UITableViewFunctions
: 이것은 내 ViewController
내부의 코드
func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) {
if tableView == self.searchListTable {
print("hello")
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
print("hello")
}
didHighlightRowAt
작동하지만 didSelectRowAt
하지 않습니다. didSelectRowAtIndexPath: not being called
어떤 다른 원인이있을 수 있습니다 :
나는이 시도?감사합니다. 당신이 didHighlightRowAt
및 didSelectRowAt
모두 응답을 원하는 경우
코드에 오류가없는 것 같습니다. 다른 장소가 잘못되어 있다면 다른 코드를 게시 할 수 있습니까? – aircraft
@ user82395214, 코드를 확인하십시오. 그게 잘못이 아니야. 둘 다 응답하고 있습니다. 'didSelectRowAt' 메쏘드의'print' 문을'print ("hello")'에서 다른 무언가로 변경하고 다시 검사 할 수 있습니까? – KrishnaCA