Essentials
테이블 뷰는 셀은 어떻게 생성하고 관리할까
재사용 큐를 사용하여 메모리를 효율적으로 사용할 수 있도록 해주는 클래스
100개의 셀이 필요한 테이블 뷰는 셀을 100개 생성하지 않는다.
dequeReusableCell(withIdentifier:)
테이블 뷰에 등록된 셀은 reuse identifier 가 있다.
정확히 이해해야 무거운 작업을 동반하는 셀의 셋업 작업을 효율적인 코드로 구현할 수 있다.
곧 셀이 보일거에요!
~~didEndDisplayingCell
보다 먼저 호출됩니다.~~ (기준에 따라 다르다)
prepareForReuse 보다 늦게 호출될까?
// 근거
the table view invokes this method
just before returning the object
from the UITableView method dequeueReusableCell(withIdentifier:)
// ++
The table view's delegate in tableView(_:cellForRowAt:)
should always reset all content when reusing a cell.
셀이 화면에서 사라졌어요!
~~willDisplayCell
보다 이후에 호출됩니다.~~ (상황에 따라 다르다)