Skip to content

Commit

Permalink
Merge branch 'S023/feat/boostcampwm-2024#11' of https://github.com/Pa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Park-kxng committed Nov 7, 2024
2 parents 57b799f + c1198fc commit 78fae93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Combine
import MusicKit

class SwipeMusicViewModel: ObservableObject {
final class SwipeMusicViewModel: ObservableObject {
@Published var music: Song?
let musicService = MusicKitService()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit
import Combine

final class SwipeMusicViewController: UIViewController {
private var viewModel = SwipeMusicViewModel()
private let viewModel = SwipeMusicViewModel()
private var cancellables = Set<AnyCancellable>()

let basicBackgroundColor = UIColor(resource: .background)
Expand Down Expand Up @@ -85,7 +85,7 @@ final class SwipeMusicViewController: UIViewController {

private func setupBindings() {
viewModel.$music
.receive(on: RunLoop.main) // 메인 스레드에서 UI 업데이트
.receive(on: RunLoop.main)
.sink { [weak self] music in
self?.setupBackgroundColor(by: music?.artwork?.backgroundColor)
}
Expand Down

0 comments on commit 78fae93

Please sign in to comment.