-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] WhiteboardList 당겨서 새로고침 구현 및 다크모드 대응 #116
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ public final class WhiteboardListViewController: UIViewController { | |
}() | ||
|
||
private let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()) | ||
private let refreshControl = UIRefreshControl() | ||
private var dataSource: UICollectionViewDiffableDataSource<Int, Whiteboard>? | ||
private let viewModel: WhiteboardListViewModel | ||
private var cancellables = Set<AnyCancellable>() | ||
|
@@ -171,8 +172,14 @@ public final class WhiteboardListViewController: UIViewController { | |
private func configureCollectionView() { | ||
collectionView.delegate = self | ||
collectionView.collectionViewLayout = createCollectionViewLayout() | ||
collectionView.backgroundColor = .white | ||
collectionView.backgroundColor = .systemBackground | ||
collectionView.register(WhiteboardCell.self, forCellWithReuseIdentifier: WhiteboardCell.reuseIdentifier) | ||
|
||
let refreshAction = UIAction { [weak self] _ in | ||
self?.refreshWhiteboardList() | ||
} | ||
refreshControl.addAction(refreshAction, for: .valueChanged) | ||
collectionView.refreshControl = refreshControl | ||
} | ||
|
||
private func createCollectionViewLayout() -> UICollectionViewLayout { | ||
|
@@ -237,14 +244,8 @@ public final class WhiteboardListViewController: UIViewController { | |
guard let dataSource = dataSource else { return } | ||
dataSource.apply(snapshot, animatingDifferences: true) | ||
} | ||
private func bind() { | ||
viewModel.output.whiteboardPublisher | ||
.receive(on: DispatchQueue.main) | ||
.sink { _ in | ||
// TODO: 화이트보드 추가 | ||
} | ||
.store(in: &cancellables) | ||
|
||
private func bind() { | ||
viewModel.output.whiteboardListPublisher | ||
.receive(on: DispatchQueue.main) | ||
.sink { [weak self] whiteboards in | ||
|
@@ -253,6 +254,13 @@ public final class WhiteboardListViewController: UIViewController { | |
} | ||
.store(in: &cancellables) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 얘 띵똥이 죽이지 않았나요 ??? whiteboardPublisher ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MPC 버그 이슈를 롤백하면서 같이 부활했나봐요 ㅋㅋㅋ큐ㅠㅠ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 삭제 완 |
||
} | ||
|
||
private func refreshWhiteboardList() { | ||
viewModel.action(input: .refreshWhiteboardList) | ||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { [weak self] in | ||
self?.refreshControl.endRefreshing() | ||
} | ||
Comment on lines
+260
to
+262
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 실제로는 화이트보드 리프레쉬가 완료되지 않았는데, endRefreshing이 되는 경우도 있을 것 같습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 킵코잉~ |
||
} | ||
} | ||
|
||
// MARK: - UICollectionViewDelegate | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어라 혹시 .airplainbalck 말고 사용하신 이요눈 뭘까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 색상은 다크모드, 라이트모드 관계 없이 검정색으로 유지되어야합니다.
이유는 cell의 색상이 흰색이라 그냥 .airplainBlack 상태에서 다크모드 전환 시 글자가 안보이는 이슈가 있었습니다!