multicast

[Combine 책 정리] Chapter 13: Resource Management
안녕하세요 코찐입니다. 아래의 자료를 따라서 공부하고 있습니다. https://www.raywenderlich.com/books/combine-asynchronous-programming-with-swift/v2.0 리소스 관리하는 Publisher 들인데, API 작업할 때 유용하게 사용할 수 있습니다. share value 타입이 아닌 reference 타입의 publisher를 공유할 수 있도록 해줍니다. 주의할 점은 이미 complete 된 share publisher를 구독하면 complete만 받게 됩니다. let shared = URLSession.shared .dataTaskPublisher(for: URL(string: "https://www.raywenderlich.com")!) .ma..

[Combine 책 정리] Chapter 9: Networking
안녕하세요 코찐입니다. 아래의 자료를 따라서 공부하고 있습니다. https://www.raywenderlich.com/books/combine-asynchronous-programming-with-swift/v2.0 한 가지 API Publisher에 여러 Subscriber가 붙는 예제입니다. let url = URL(string: "https://www.raywenderlich.com")! let publisher = URLSession.shared .dataTaskPublisher(for: url) .map(\.data) .multicast { PassthroughSubject() } let subscription1 = publisher .sink(receiveCompletion: { complet..