Memory and ARC쿠팡
Subscription lifetime
In a live coding session you're handed the following Combine ViewModel. Add a feature that subscribes to the price stream and reflects it in priceText, and explain, with code, how you'd handle unsubscribing.
final class ProductViewModel {
@Published var priceText = ""
private let priceStream: AnyPublisher<Decimal, Never>
init(priceStream: AnyPublisher<Decimal, Never>) {
self.priceStream = priceStream
}
}