| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
- rib
- memory safety
- in-out
- Concurrent
- iOS 버전 점유율
- SWIFT
- swiftdocs
- windowScene
- Dependency Rule
- Large File Storage
- coordinateSpace
- App Signing
- 잡초가득블로그
- 로버트마틴형
- Git Large File Storage
- RIBs Tutorial
- 클린아키텍쳐
- Automatically manage signing
- Apple Certificate
- 대머리깃허브
- ios
- Github file size
- Ribs
- RxCocoa
- Dispatch.main.sync
- iOS Target
- 메모리 접근 충돌
- UICoordinateSpace
- conflicting access to memory
- RxSwift
- Today
- Total
빙수왕의 개발일지
RxCocoa를 사용하여 UITableViewCell을 구성하는 방법 본문
4가지 방법이 있다.

출처
https://github.com/RxSwiftCommunity/RxDataSources
RxSwiftCommunity/RxDataSources
UITableView and UICollectionView Data Sources for RxSwift (sections, animated updates, editing ...) - RxSwiftCommunity/RxDataSources
github.com
각각 언제 사용하는가?
1) rx.items(dataSource:protocol<RxTableViewDataSourceType, UITableViewDataSource>)
- 아직 안써봄. dataSource를 넣어주는걸 봐선 아주 세밀한 커스텀(?)이 필요할 때 쓰일 것 같다.
2) rx.items(cellIdentifier:String)
- cell 커스텀 클래스를 안만들었을 때, identifier만 지정하여 사용. (기본 UITableViewCell을 사용) 난 사용할 일 없을듯..
3) rx.items(cellIdentifier:String:Cell.Type:_:)
- 한가지 셀을 사용하여 TableView를 구성할 때 사용 (2와의 차이는 3은 cell커스텀 클래스를 만들었을 때.)
- cell이 closure의 전달인자로 넘어온다. closure에서 cell을 리턴하지 않는다.

4) rx.items(_:_:)
- 다양한 셀로 TableView를 구성할 때 사용
- tableView가 closure의 전달인자로 넘어온다. closure에서 UITableViewCell을 리턴해야 한다.

주의사항
rx로 UITableView를 구성할 때, DataSource를 대체해주어 편리하지만 cell Register은 빼먹으면 안된다~~
이건 rx랑 상관없이 Storyboard(또는 xib)로 테이블뷰를 만들었을 경우, 그 안에 cell이 들어가있는 경우가 아니면 모두 등록해줘야 하는거다. (스토리보드에서 셀을 끌어다가 테이블뷰에 넣는 작업 == register 임)
'개발 > iOS' 카테고리의 다른 글
| RxSwift, RxCocoa, RxRelay의 Observable, Subject, Driver, Signal, Relay 표로 정리 (0) | 2021.06.24 |
|---|---|
| XCode에서 Breakpoint가 안먹고 디버깅이 안될 때 (0) | 2021.06.24 |
| 디자인패턴들 정리(2) - Facade, Adapter, Observer, Coordinator, Command (0) | 2021.06.17 |
| 디자인패턴들 정리(1) - Singleton, Factory, Decorator (0) | 2021.06.17 |
| 유투브 샘플앱으로 무작정 RxSwift + MVVM 사용해보기 (0) | 2021.06.16 |