Skip to content
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

chore: upload notification 개선 #232

Merged
merged 1 commit into from
Dec 6, 2023
Merged

chore: upload notification 개선 #232

merged 1 commit into from
Dec 6, 2023

Conversation

anyukyung
Copy link
Member

🧑‍🚀 PR 요약

해당 pr에서 작업한 내역을 적어주세요.

  • 처음에는 NotificationQueue를 사용하려고 했는데 프로그레스바에 경우 바로바로 화면에 반영이 되어야해서 postingStylenow로 지정해주어야 했어요
  • 그런데 now로 지정해주면 동기적으로 동작하는 NotificationCenter에 post하는 것과 동일해서 그냥 NotificationCenter에 Post하도록 변경했습니다
  • 다만 @ objc로 작성된 selector들을 제거했고
  • 씬델리게이트에서 수행할 함수들이 모두 화면 업데이트와 관련된 것들이어서 notification이 mainthread에서 돌아갈 수 있도록 queue를 main으로 변경해서 불필요한 코드를 제거했습니다 !
NotificationCenter.default.addObserver(forName: .uploadTaskStart, object: nil, queue: .main)

Linked Issue

close #230

Copy link
Collaborator

@loinsir loinsir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotificationQueue에 대한 리서칭을 잘해주셨네요
리팩토링 사항 동의해서 Approve 하겠습니다~
고생하셨어요

Comment on lines +74 to +82
NotificationCenter.default.addObserver(forName: .uploadTaskStart, object: nil, queue: .main) { [weak self] _ in
self?.showProgressView()
}
NotificationCenter.default.addObserver(forName: .progressChanged, object: nil, queue: .main) { [weak self] notification in
self?.progressChanged(notification)
}
NotificationCenter.default.addObserver(forName: .uploadTaskDidComplete, object: nil, queue: .main) { [weak self] _ in
self?.removeProgressView()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@anyukyung anyukyung merged commit f001a88 into iOS/dev Dec 6, 2023
1 check passed
@anyukyung anyukyung deleted the iOS/chore#230 branch December 6, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants