본문 바로가기

Swift

불필요한 비어있는 tableview cell 안 보이게 하기

불필요하게 빈 칸인 테이블뷰의 셀이 보이는 경우가 있다.

이게 보기 싫다면 다음과 같은 꼼수로 안 보이게 할 수 있다.

바로 tableFooterView를 설정함으로써 이런 효과를 거둘 수 있다.

아래 코드를 viewDidLoad 등에 넣어주면 된다.


let footerView = UIView()
footerView.backgroundColor = UIColor.clearColor()
levelTableView.tableFooterView = footerView