Skip to content

Commit

Permalink
Merge branch 'develop' into S023/feat/boostcampwm-2024#11
Browse files Browse the repository at this point in the history
  • Loading branch information
Park-kxng authored Nov 7, 2024
2 parents 44e6f9f + 09bb53a commit c1198fc
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(named: "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 c1198fc

Please sign in to comment.