-
iOS [Swift] - Custom Cell 적용하기iOS Develop 2022. 4. 18. 09:59반응형
1. Cocoa Class로 xib까지 같이 생성해서 Cell 생성하고 identifier 설정해주기.
2. tableView나 CollectionView에 등록을 해준다.
tableView.register(UINib(nibName: "CustomCell", bundle: nil), forCellReuseIdentifier: "cell")3. tableView 설정 메소드에서 cell을 꺼내다 쓴다.
guard let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as? CustomCell else { return UITableViewCell() }'iOS Develop' 카테고리의 다른 글
iOS [Swift] - ScrollView 간단 파헤치기 (0) 2022.04.19 iOS [Swift] - iOS 15 이상 TabBar BartintColor 변경하기 (0) 2022.04.18 iOS [Swift] - height constraint Outlet 변수 생성 (0) 2022.04.05 iOS [Swift] - HealthKit Query 정리 (0) 2022.03.29 iOS [Swift] - WatchOS HealthKit Background (0) 2022.03.23