Skip to content

Commit

Permalink
🎨 Timer background에서 돌릴 수 있도록 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mingun authored and mingun committed Dec 11, 2023
1 parent dcf3a65 commit d686438
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public final class RewindJourneyViewController: UIViewController {

private var cancellables: Set<AnyCancellable> = []
private var presentingImageIndex: Int? {
didSet { self.changeProgressViews() }
didSet {
DispatchQueue.main.async { self.changeProgressViews() }
}
}

// MARK: - Properties: Timer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private extension RewindJourneyViewModel {
func startTimer() {
self.timer = Timer.publish(every: self.timerTimeInterval, on: .main, in: .common)
.autoconnect()
.receive(on: DispatchQueue.global(qos: .background))
.sink { [weak self] _ in
self?.state.timerPublisher.send()
}
Expand Down

0 comments on commit d686438

Please sign in to comment.