로딩
요청 처리 중입니다...

[iOS/Combine] UIKit + Combine example code

 [iOS/Combine] UIKit + Combine example code

MVVM 구조를 이용해서 간단히 UIKit과 컴바인을 사용하는 법을 알아보자 먼저 ViewModel 쪽이다. import Foundation import Combine class ViewModel: ObservableObject { @Published private(set) var title = "" @Published private(set) var tappedCount = 0 @Published private(set) var labelTitle = "" init() { configure() } private func configure() { title = "Combine MVVM UIKit Test" labelTitle = "\(something.count)번 눌림" } func tapped() { something.count += 1 } } 이를 바탕으로 받아오는 ViewController import UIKit import Combine import CombineCocoa im...