내 사용자 지정 TableViewCell 중 하나의 단추를 누르면 다른 사용자 지정 TableViewCell에서 이미지를 숨기거나 숨김을 취소하고 싶습니다. 내 세포는 섹션으로 정렬됩니다.보기 중에 UITableView 다시로드 섹션
버튼을 누르고 다른보기로 전환 한 다음 다시 내 TableView로 돌아 가면 변경 사항이 적용됩니다. 보기를 전환 할 필요없이 즉시 변경 사항을 표시하고 싶습니다.
내 코드 :
let otherCellIndexPath = IndexPath(item: 0, section: 0)
let otherCell = tableView.cellForRow(at: oldIndexPath) as! CustomTableViewCell
otherCell.hideImage()
let currentCell = tableView.cellForRow(at: indexPath) as! CustomTableViewCell
currentCell.showImage()
tableView.beginUpdates()
tableView.reloadSections([otherCellIndexPath,indexPath], with: .none)
tableView.endUpdates()
나는 무엇을 놓치고? (Xcode 8 b6, Swift 3 사용)
'tableview.reloadData()'를 시도 했습니까? – John
테이블 뷰를 숨기고 다시로드하려는 배열에서 객체를 제거하기 만하면됩니다. –