# Combine: Asynchronous Programming with Swift

**URL:** https://forums.kodeco.com/c/books/combine-asynchronous-programming-with-swift/57.md?page=1

[Latest](https://forums.kodeco.com/latest.md) · [Categories](https://forums.kodeco.com/categories.md) · [Tags](https://forums.kodeco.com/tags.md)

**Page:** 2

---

## [Assign operator can cause a strong reference cycle](https://forums.kodeco.com/t/assign-operator-can-cause-a-strong-reference-cycle/155775)

<div class="topic-metadata">

**Author:** [@anon58552229](https://forums.kodeco.com/u/anon58552229)\
**Replies:** 2\
**Last updated:** [December 27, 2021, 2:27am UTC](https://forums.kodeco.com/t/assign-operator-can-cause-a-strong-reference-cycle/155775 "2021-12-27T02:27:26Z")

</div>

assign(to: \\.word, on: self) and storing the resulting AnyCancellable results in a strong reference cycle. Replacing assign(to:on:) with assign(to: &$word) prevents this problem not sure why

---

## [\[Combine\]subscribe method](https://forums.kodeco.com/t/combine-subscribe-method/158426)

<div class="topic-metadata">

**Author:** [@anon58552229](https://forums.kodeco.com/u/anon58552229)\
**Replies:** 2\
**Last updated:** [December 19, 2021, 3:07pm UTC](https://forums.kodeco.com/t/combine-subscribe-method/158426 "2021-12-19T15:07:11Z")

</div>

I know publisher has a method subscribe(\_ subject: Subject) let arrPublisher = \[1,2,3,4\].publisher let tester = PassthroughSubject\<Int, Never\>() arrPublisher.sink { result in print(result) }.store(in: &subscription…

---

## [\[Combine\]throttle bug?](https://forums.kodeco.com/t/combine-throttle-bug/158530)

<div class="topic-metadata">

**Author:** [@anon58552229](https://forums.kodeco.com/u/anon58552229)\
**Replies:** 1\
**Last updated:** [November 29, 2021, 9:03am UTC](https://forums.kodeco.com/t/combine-throttle-bug/158530 "2021-11-29T09:03:40Z")

</div>

let subject = PassthroughSubject\<String, Never\>() let throttled = subject.throttle(for: .seconds(10), scheduler: DispatchQueue.main, latest: false) throttled.sink(receiveValue: {print($0, Date())}) .store(in: &subs…

---

## [\[Coombine\]\[Publishers\] how to use maxPublishers](https://forums.kodeco.com/t/coombine-publishers-how-to-use-maxpublishers/158113)

<div class="topic-metadata">

**Author:** [@anon58552229](https://forums.kodeco.com/u/anon58552229)\
**Replies:** 0\
**Last updated:** [November 20, 2021, 2:13pm UTC](https://forums.kodeco.com/t/coombine-publishers-how-to-use-maxpublishers/158113 "2021-11-20T14:13:46Z")

</div>

not sure the following logic will create three publishers? \[1,2,3\].publisher \[1,2,3,4\].publisher .flatMap(maxPublishers: .max(1)) { result in change(result) }.sink { result in print(result) }.store(in: &subscripti…

---

## [Return subscription on subscribe](https://forums.kodeco.com/t/return-subscription-on-subscribe/156767)

<div class="topic-metadata">

**Author:** [@dwroth](https://forums.kodeco.com/u/dwroth)\
**Replies:** 0\
**Last updated:** [November 11, 2021, 5:06pm UTC](https://forums.kodeco.com/t/return-subscription-on-subscribe/156767 "2021-11-11T17:06:32Z")

</div>

I’m trying to figure out how Apple’s own sink subscriber (more specifically, the sink extension on Publisher) is able to subscribe and then immediately return its subscription. Combine does offer a form of the subscribe\<S…

---

## [Chapter 8.1 help with .assign(to:)](https://forums.kodeco.com/t/chapter-8-1-help-with-assign-to/153063)

<div class="topic-metadata">

**Author:** [@danielpressner](https://forums.kodeco.com/u/danielpressner)\
**Replies:** 1\
**Last updated:** [October 14, 2021, 10:42am UTC](https://forums.kodeco.com/t/chapter-8-1-help-with-assign-to/153063 "2021-10-14T10:42:52Z")

</div>

When I add the line to func bindMainView() - .assign(to: &imagePreview) I get the following error: Cannot convert value of type ‘UIImage?’ to expected argument type ‘Published\<UIImage\>.Publisher’ I’ve gone over the co…

---

## [I cannot open all the playground files](https://forums.kodeco.com/t/i-cannot-open-all-the-playground-files/149060)

<div class="topic-metadata">

**Author:** [@ys\_xs](https://forums.kodeco.com/u/ys_xs)\
**Replies:** 6\
**Last updated:** [October 8, 2021, 9:05am UTC](https://forums.kodeco.com/t/i-cannot-open-all-the-playground-files/149060 "2021-10-08T09:05:07Z")

</div>

All the playground files in version 3.0 cannot be open, it says: The document “playground.xcworkspace” cound not be opened.

---

## [I really love the old cover](https://forums.kodeco.com/t/i-really-love-the-old-cover/149241)

<div class="topic-metadata">

**Author:** [@spencerfeng](https://forums.kodeco.com/u/spencerfeng)\
**Replies:** 1\
**Last updated:** [October 3, 2021, 9:39pm UTC](https://forums.kodeco.com/t/i-really-love-the-old-cover/149241 "2021-10-03T21:39:51Z")

</div>

Hi there, I really love the old book cover.

---

## [Chapter 2: async/await example issue](https://forums.kodeco.com/t/chapter-2-async-await-example-issue/149194)

<div class="topic-metadata">

**Author:** [@daviderb](https://forums.kodeco.com/u/daviderb)\
**Replies:** 2\
**Last updated:** [October 2, 2021, 6:24pm UTC](https://forums.kodeco.com/t/chapter-2-async-await-example-issue/149194 "2021-10-02T18:24:32Z")

</div>

With Xcode version 13.0 (13A233), the async/await example near the end of Chapter 2 doesn’t work in a playground. If you add the following import import \_Concurrency to the playground, it works fine.

---

## [Version 3 update changes](https://forums.kodeco.com/t/version-3-update-changes/149005)

<div class="topic-metadata">

**Author:** [@kchen](https://forums.kodeco.com/u/kchen)\
**Replies:** 2\
**Last updated:** [September 29, 2021, 8:55pm UTC](https://forums.kodeco.com/t/version-3-update-changes/149005 "2021-09-29T20:55:55Z")

</div>

Could we write a note about what’s new in version 3? Since I have read version 2, I just want to read the updated part in version 3. Thanks!

---

## [Combine ownership model: Subscription -\> Subscriber -\> Publisher](https://forums.kodeco.com/t/combine-ownership-model-subscription-subscriber-publisher/145753)

<div class="topic-metadata">

**Author:** [@altairs99](https://forums.kodeco.com/u/altairs99)\
**Replies:** 2\
**Last updated:** [August 20, 2021, 11:45am UTC](https://forums.kodeco.com/t/combine-ownership-model-subscription-subscriber-publisher/145753 "2021-08-20T11:45:21Z")

</div>

Hello @icanzilb , I have couple questions about ownership model between Subscription → Subscriber → Publisher. Sorry many letters :slight\_smile: Subscriber (sink) will be alive since we do .store(in: &subscriptions). …

---

## [\[Chapter 18\] Implementing a ShareReplay operator, subscribe to upstream](https://forums.kodeco.com/t/chapter-18-implementing-a-sharereplay-operator-subscribe-to-upstream/146171)

<div class="topic-metadata">

**Author:** [@altairs99](https://forums.kodeco.com/u/altairs99)\
**Replies:** 2\
**Last updated:** [August 20, 2021, 11:42am UTC](https://forums.kodeco.com/t/chapter-18-implementing-a-sharereplay-operator-subscribe-to-upstream/146171 "2021-08-20T11:42:05Z")

</div>

Hello @fpillet , Thank you for the great article for in-depth explanations! I am wandering about snippet of code below. Why API design upstream.subscribe(sink) doesn’t return subscription as in other cases for memory m…

---

## [Chapter 8: Presenting a view controller as a Future](https://forums.kodeco.com/t/chapter-8-presenting-a-view-controller-as-a-future/105613)

<div class="topic-metadata">

**Author:** [@camacholaverde](https://forums.kodeco.com/u/camacholaverde)\
**Replies:** 3\
**Last updated:** [August 3, 2021, 4:04pm UTC](https://forums.kodeco.com/t/chapter-8-presenting-a-view-controller-as-a-future/105613 "2021-08-03T16:04:02Z")

</div>

Hello, I have been trying the code related to the presentation of the Alert view controller as a Future, and I have some questions. In order to dismiss the presented alert, you suggest to include a handleEvents(receiveC…

---

## [\[Combine\] Chapter 14: In Practice: Project "News". MergeMany custom implementation](https://forums.kodeco.com/t/combine-chapter-14-in-practice-project-news-mergemany-custom-implementation/145490)

<div class="topic-metadata">

**Author:** [@altairs99](https://forums.kodeco.com/u/altairs99)\
**Replies:** 1\
**Last updated:** [August 3, 2021, 4:01pm UTC](https://forums.kodeco.com/t/combine-chapter-14-in-practice-project-news-mergemany-custom-implementation/145490 "2021-08-03T16:01:19Z")

</div>

Hello @icanzilb , Thank you for the snippet with custom MergeMany implementation, looks great! I am wondering if we can start with empty publisher and remove not empty precondition? For example: // let initialPubl…

---

## [Marble diagrams in Ch 3?](https://forums.kodeco.com/t/marble-diagrams-in-ch-3/141603)

<div class="topic-metadata">

**Author:** [@jetforme](https://forums.kodeco.com/u/jetforme)\
**Replies:** 1\
**Last updated:** [June 5, 2021, 11:57am UTC](https://forums.kodeco.com/t/marble-diagrams-in-ch-3/141603 "2021-06-05T11:57:13Z")

</div>

How do you guys generate the marble diagrams in Ch 3? I found some handy tools online, but their diagrams aren’t as pretty as yours. Did you use a similar tool, or generate them yourselves?

---

## [Combine: flatMap not allowing to change object value](https://forums.kodeco.com/t/combine-flatmap-not-allowing-to-change-object-value/140958)

<div class="topic-metadata">

**Author:** [@ankit\_tlp](https://forums.kodeco.com/u/ankit_tlp)\
**Replies:** 0\
**Last updated:** [May 26, 2021, 9:09pm UTC](https://forums.kodeco.com/t/combine-flatmap-not-allowing-to-change-object-value/140958 "2021-05-26T21:09:49Z")

</div>

This is Combine publisher stream that i am creating to get input from text and making web api request. But the problem i am facing is changing the request object’s properties (any mutable property in request object). Be…

---

## [Errata for Combine: Asynchronous Programming with Swift 2nd Edition](https://forums.kodeco.com/t/errata-for-combine-asynchronous-programming-with-swift-2nd-edition/126149)

<div class="topic-metadata">

**Author:** [@mandafrederick](https://forums.kodeco.com/u/mandafrederick)\
**Replies:** 6\
**Last updated:** [May 11, 2021, 6:49pm UTC](https://forums.kodeco.com/t/errata-for-combine-asynchronous-programming-with-swift-2nd-edition/126149 "2021-05-11T18:49:01Z")

</div>

Creating this topic to catch any typos and bugs in the 2nd Edition of Combine: Asynchronous Programming with Swift.

---

## [Combine and Clean Architecture](https://forums.kodeco.com/t/combine-and-clean-architecture/138069)

<div class="topic-metadata">

**Author:** [@rchampa](https://forums.kodeco.com/u/rchampa)\
**Replies:** 2\
**Last updated:** [April 20, 2021, 9:39am UTC](https://forums.kodeco.com/t/combine-and-clean-architecture/138069 "2021-04-20T09:39:17Z")

</div>

Hi everyone. I’m learning a lot of from Combine thanks to this amazing book. Currently i’m writing an app and following the clean MVVM architecture. Then I have the following Layers: Domain(UseCases and RepositoryPro…

---

## [Chapter 20: Translation service no longer supports free accounts](https://forums.kodeco.com/t/chapter-20-translation-service-no-longer-supports-free-accounts/118990)

<div class="topic-metadata">

**Author:** [@rocketdocaz](https://forums.kodeco.com/u/rocketdocaz)\
**Replies:** 2\
**Last updated:** [April 17, 2021, 8:58pm UTC](https://forums.kodeco.com/t/chapter-20-translation-service-no-longer-supports-free-accounts/118990 "2021-04-17T20:58:10Z")

</div>

The Yandex translation service no longer (as of 8/15/20) supports free accounts, so the API key included in the project is no longer valid. Using this causes fetch(for:to:) to always fail with an error, causing the untr…

---

## [Chapter 15 - Subscribing to an external publisher](https://forums.kodeco.com/t/chapter-15-subscribing-to-an-external-publisher/105056)

<div class="topic-metadata">

**Author:** [@miibpa](https://forums.kodeco.com/u/miibpa)\
**Replies:** 9\
**Last updated:** [April 9, 2021, 6:39pm UTC](https://forums.kodeco.com/t/chapter-15-subscribing-to-an-external-publisher/105056 "2021-04-09T18:39:26Z")

</div>

Hi, I’m doing the excersices related with this chapter, I’ve found that either following the book’s code or opening the final project the ´onReceive´ method is not being triggered

---

## [Received Cancel in Chapter 2](https://forums.kodeco.com/t/received-cancel-in-chapter-2/91581)

<div class="topic-metadata">

**Author:** [@velin92](https://forums.kodeco.com/u/velin92)\
**Replies:** 6\
**Last updated:** [April 4, 2021, 2:56am UTC](https://forums.kodeco.com/t/received-cancel-in-chapter-2/91581 "2021-04-04T02:56:30Z")

</div>

Hello! I am actually following the Combine book, and it’s very interesting and detailed. However there is a weird behavior that is differing from the one explained in the book. If I use the store(in:) function to stor…

---

## [Subscription and Subscriber](https://forums.kodeco.com/t/subscription-and-subscriber/136173)

<div class="topic-metadata">

**Author:** [@richmond\_jam](https://forums.kodeco.com/u/richmond_jam)\
**Replies:** 2\
**Last updated:** [March 30, 2021, 4:14am UTC](https://forums.kodeco.com/t/subscription-and-subscriber/136173 "2021-03-30T04:14:23Z")

</div>

Hello, I am a beginner of Combine Framework. And I have a question to wanna get answer. Would you please tell me what the essential different between subscription and subscriber. I just only know they confirm different p…

---

## [Errata for Combine: Asynchronous Programming with Swift 1st Edition](https://forums.kodeco.com/t/errata-for-combine-asynchronous-programming-with-swift-1st-edition/79656)

<div class="topic-metadata">

**Author:** [@mandafrederick](https://forums.kodeco.com/u/mandafrederick)\
**Replies:** 66\
**Last updated:** [March 20, 2021, 9:34pm UTC](https://forums.kodeco.com/t/errata-for-combine-asynchronous-programming-with-swift-1st-edition/79656 "2021-03-20T21:34:49Z")

</div>

Creating this topic to catch any typos and bugs in the 1st Edition of Combine: Asynchronous Programming with Swift.

---

## [Chapter 15 multiple settings](https://forums.kodeco.com/t/chapter-15-multiple-settings/133490)

<div class="topic-metadata">

**Author:** [@coopersita](https://forums.kodeco.com/u/coopersita)\
**Replies:** 0\
**Last updated:** [February 23, 2021, 10:48pm UTC](https://forums.kodeco.com/t/chapter-15-multiple-settings/133490 "2021-02-23T22:48:20Z")

</div>

In chapter 15, the HNReader app has a settings page with one setting (keywords), but how can you modify it so that your settings app could have multiple settings without having multiple env variables. I was trying to us…

---

## [Question about Chapter 8 Challenge Part 1: share() publisher](https://forums.kodeco.com/t/question-about-chapter-8-challenge-part-1-share-publisher/129329)

<div class="topic-metadata">

**Author:** [@xlzhsteven](https://forums.kodeco.com/u/xlzhsteven)\
**Replies:** 2\
**Last updated:** [January 9, 2021, 1:41pm UTC](https://forums.kodeco.com/t/question-about-chapter-8-challenge-part-1-share-publisher/129329 "2021-01-09T13:41:52Z")

</div>

let newPhotos = photos.selectedPhotos .filter { $0.size.width \> $0.size.height } .prefix(while: { \[unowned self\] \_ in return self.images.value.count \< 6 }) .share() newPhotos .map { \[unowned self\] newImage…

---

## [Chapter 20 Challenge](https://forums.kodeco.com/t/chapter-20-challenge/129657)

<div class="topic-metadata">

**Author:** [@jackyoung](https://forums.kodeco.com/u/jackyoung)\
**Replies:** 0\
**Last updated:** [January 9, 2021, 10:36am UTC](https://forums.kodeco.com/t/chapter-20-challenge/129657 "2021-01-09T10:36:49Z")

</div>

There appears to be a difference between the source code on the starter and final challenges on chapter 20, which causes the last test to fail even if you have the right solution. In the mock jokes service the book tells…

---

## [Using 'Just' vs simply passing the value?](https://forums.kodeco.com/t/using-just-vs-simply-passing-the-value/129597)

<div class="topic-metadata">

**Author:** [@bauermusic](https://forums.kodeco.com/u/bauermusic)\
**Replies:** 0\
**Last updated:** [January 8, 2021, 11:24am UTC](https://forums.kodeco.com/t/using-just-vs-simply-passing-the-value/129597 "2021-01-08T11:24:38Z")

</div>

Quite possible that later on, the real usefulness of a Just publisher will become clear. But at the first introduction, I cannot think of a real use case where I would send a ‘Just’ instance, only to get its value back s…

---

## [Cannot find sample code anywhere](https://forums.kodeco.com/t/cannot-find-sample-code-anywhere/129024)

<div class="topic-metadata">

**Author:** [@bauermusic](https://forums.kodeco.com/u/bauermusic)\
**Replies:** 6\
**Last updated:** [January 7, 2021, 6:55pm UTC](https://forums.kodeco.com/t/cannot-find-sample-code-anywhere/129024 "2021-01-07T18:55:37Z")

</div>

Been searching for a long time now for the sample code. The link in the book leads to the store. There are no links to any sample code. Finally found something on GitHub (is that official?), but it looks different than t…

---

## [Failed to demangle witness error when using Realm in a custom Publisher](https://forums.kodeco.com/t/failed-to-demangle-witness-error-when-using-realm-in-a-custom-publisher/94495)

<div class="topic-metadata">

**Author:** [@rustprooffish](https://forums.kodeco.com/u/rustprooffish)\
**Replies:** 3\
**Last updated:** [December 23, 2020, 3:00am UTC](https://forums.kodeco.com/t/failed-to-demangle-witness-error-when-using-realm-in-a-custom-publisher/94495 "2020-12-23T03:00:37Z")

</div>

This question actually crosses over between the RW Combine and Realm books but, as they share some authors I’m hoping this won’t cause a problem. I’m attempting to test a custom Publisher that emits Realm object arrays …

---

## [Errata for Combine: Asynchronous Programming with Swift 1st Edition (v1.0.3)](https://forums.kodeco.com/t/errata-for-combine-asynchronous-programming-with-swift-1st-edition-v1-0-3/98574)

<div class="topic-metadata">

**Author:** [@mandafrederick](https://forums.kodeco.com/u/mandafrederick)\
**Replies:** 25\
**Last updated:** [November 28, 2020, 11:25pm UTC](https://forums.kodeco.com/t/errata-for-combine-asynchronous-programming-with-swift-1st-edition-v1-0-3/98574 "2020-11-28T23:25:07Z")

</div>

Creating this fresh topic to catch any typos and bugs in the 1st Edition of Combine: Asynchronous Programming with Swift (v1.0.3) The old topic can be read here: Combine: Asynchronous Programming with Swift - kodeco.com…

[Previous page](https://forums.kodeco.com/c/books/combine-asynchronous-programming-with-swift/57.md)

[Next page](https://forums.kodeco.com/c/books/combine-asynchronous-programming-with-swift/57.md?page=2)
