일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- clean architecture
- 클린 코드
- SWIFT
- collectionview
- tableView
- swift documentation
- MVVM
- ios
- rxswift
- uitableview
- RxCocoa
- Observable
- Human interface guide
- Xcode
- 리펙토링
- 스위프트
- 애니메이션
- 리팩토링
- Protocol
- combine
- UICollectionView
- uiscrollview
- Refactoring
- 리펙터링
- Clean Code
- HIG
- UITextView
- ribs
- swiftUI
- map
- Today
- Total
목록performBatchUpdates (2)
김종권의 iOS 앱 개발 알아가기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/ceGklL/btrgApZh88d/QeXnM5kgND7iHf9oe7ADn1/img.gif)
1. Diffable Data Source - UITableViewDiffableDataSource (테이블 뷰) 2. Diffable Data Source - UICollectionViewDiffableDataSource (컬렉션 뷰) 원리 기존 Controller와 UI의 관계 UI가 Controller에게 cell의 모양(cellForRowAt), cell의 개수(numberOfRowsInSection)을 델리게이트로부터 받아서 처리 기존은 특정 cell만 바뀐경우의 처리는 아래와 같이 처리 방법 1) performBatchUpdates()의 클로저 블록에 데이터 변경 작업 추가 방법 2) beginUpdates()와 endupdates() 사이에 데이터 변경 작업 작성 iOS13+에서 단순히 ap..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/eeL63x/btrduIFvSor/xdkw07giSyEKkg7LGVVLU1/img.png)
CollectionView의 연산 3가지 insert, move, delete 3가지 연산의 dicussion에 모두 performBatchUpdates를 사용하여 각 연산의 변경을 동시에 animate를 줄 수 있는 방법 performBatchUpdates(_:completion:) 여러개의 변경 후 completion 블럭을 사용할 수 있기 때문에 사용 코드의 순서에 상관 없이 insert 연산전에 delete 연산이 수행됨을 주의 > 삭제 후 index값 기준으로 index가 처리되므로 주의 performBatchUpdates(_:completion:) 사용 collectionView 준비 class ViewController: UIViewController { // Views lazy var co..