diff --git a/Molio/Source/Presentation/SwipeMusic/SwipeMusicViewModel.swift b/Molio/Source/Presentation/SwipeMusic/SwipeMusicViewModel.swift index 9902201..ed2ee86 100644 --- a/Molio/Source/Presentation/SwipeMusic/SwipeMusicViewModel.swift +++ b/Molio/Source/Presentation/SwipeMusic/SwipeMusicViewModel.swift @@ -2,7 +2,7 @@ import Foundation import Combine import MusicKit -class SwipeMusicViewModel: ObservableObject { +final class SwipeMusicViewModel: ObservableObject { @Published var music: Song? let musicService = MusicKitService() diff --git a/Molio/Source/Presentation/SwipeMusic/View/SwipeMusicViewController.swift b/Molio/Source/Presentation/SwipeMusic/View/SwipeMusicViewController.swift index bdf6114..68f7ae1 100644 --- a/Molio/Source/Presentation/SwipeMusic/View/SwipeMusicViewController.swift +++ b/Molio/Source/Presentation/SwipeMusic/View/SwipeMusicViewController.swift @@ -2,7 +2,7 @@ import UIKit import Combine final class SwipeMusicViewController: UIViewController { - private var viewModel = SwipeMusicViewModel() + private let viewModel = SwipeMusicViewModel() private var cancellables = Set() let basicBackgroundColor = UIColor(named: "background") @@ -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) }