Will I get an email when the Combine book is published? (v1) (I have purchased)
Yup, youāre supposed to get an e-mail once the full release is out You can also follow @rwenderlich on Twitter to get the latest news on that.
@dad great catch! Will have that fixed for the final release.
Happy for more feedback from everyone as we approach the final release of the book! :]
Hi @dad, thanks for pointing this out. I did remove this remnant when it was first reported, but Iām not sure why that change didnāt make it into the last release. However, I just double-checked and itās definitely not there in the current version, for the next release. Thanks again and I hope youāre enjoying the book so far!
@freak4pc Just to let you know: I did not get an email saying that v0.3.0 was released and I would have expected to (it was at v0.2.0 when I purchased). Could have just been a crazy timing thing, but thought Iād let you know.
Hey, I finished reading v0.3
and so far it is great. Congrats!
I did catch some small typos here and there, but the one I can remember is in Chapter 6 (page 147) when talking about debounce and throttle. Specifically the timing example typingHelloWorld
. The last element finishes at 2.5
seconds; however 2 pages later (in the debounce printout), the code finishes at 2.7
and 3.7
(instead of 2.5
and 3.5
). Also 2.1
is repeated twice (instead of being 2.0
and 2.1
). The same thing happens with the throttle
printout.
I know the explanation is a bit confusing, but please check the code and it should be clear. The example is great to figure out the difference between the two functions. I quite liked it! I would have loved a side-by-side comparison, though. Something similar to this:
It is just a suggestion, since I found myself going back and forth through the different pages. In any case, keep up the good work.
v0.3 Chapter 2, page 54
This happens because the subject previously sent a completion event that the second subscriber did receive but the first subscriber did not because it was no longer subscribed
Looks like it should be:
This happens because the subject previously sent a completion event that the first subscriber did receive but the second subscriber did not because it was no longer subscribed
P48
You also add a subscriptions set in which youāll store the subscriptions to the future in the example
This never happens
P63
Type erasure enables prevents callers from being able to access additional details of the underlying type
Type erasure prevents callers from being able to access additional details of the underlying type
Chapter 7
Starter Playground is the same as Finish Playground i.e all the code has been filled in.
Chapter 8 ā project doesnāt work if you try and resave photos due to the cancel subscription call in viewWillDisappear. To replicate - go back to PhotosViewController a second time and try and save more photos.
( Is storing each subscriber in subscriptions not sufficient and doesnāt the subscriber get removed once photosViewController is dismissed and deinitialized ???)
P209
A random p is included after
Websocket tasks to connect to websockets.
Hi @dehesa,
Thanks for taking the time to write down your notes and make this very nice table. While itās too late to change this edition of the book we may definitely consider something similar to highlight the differences between throttle
and debounce
. It is a nice visual cheat sheet that will help beginners. Congrats for coming up with this!
Regarding the timing issues, there may be some slight discrepancy (delay) due to scheduling on a queue: delivery at a precise time is not guaranteed when using DispatchQueue.asyncAfter
(note the after
part of the call). This is something Iāll make a note about in the next edition of the book, thanks for catching it!
v0.3
P73
There is an inconsistency between the code and the shown output.
I think the following line is missing:
publisher.send(Coordinate(x: 0, y: 5))
Thank you! Thatās indeed a mistake and will be fixed on the final release.
Hi @kyrya, thanks for bringing this to our attention. I do think the wording is correct, however it definitely could be worded better. Iāve changed it to:
Run the playground. The second subscriber does not receive the "How about another one?"
value, because it received the completion event right before that value was sent. The first subscriber does not receive the completion event or the value, because its subscription was previously canceled.
Thanks again!
Any ideas when the next edition is coming out? Will the next one be the full release?
Thanks
Yes, the full 1.0 release is pending publication.
That is awesome!! canāt wait for it!! Congratulations
And itās out!
Combine version 1.0 (I think, be nice if the version # of the book was easy to find inside the book in iBooks, perhaps on the copyright page?) Chapter 8 āwrapping a callback function as a futureā section, comment number positions for this section seem off:
ā// 1
try PHPhotoLibrary.shared().performChangesAndWait {
// 2
let request = PHAssetChangeRequest.creationRequestForAsset(from: image)
// 3
guard let savedAssetID =
request.placeholderForCreatedAsset?.localIdentifier else {
return resolve(.failure(.couldNotSavePhoto))
}
// 4
resolve(.success(savedAssetID))
}ā
The explanation says: ā1. First you create a request to store imageā and ā2. Then you attempt to get the newly-created assetās identifier via request.placeholderForCreatedAsset?.localIdentifierā. Comment #3 position also seems a couple lines high. Comment #4 positioning is correct.
I feel like Iām going crazy, but I think the very first example of sink on page 41 is missing
center.post(name: myNotification, object: nil)
I can see it in Final.playground, but the PDF doesnāt seem to include it.
Iām working through Chapter 8 Challenges.
The challenge states:
āOnce youāre finished with your first task, create a new subscription to newPhotos which:
-
Ignore all values and only pass a completion event. You can use ignoreOutput(), just like earlier in the chapter.
-
Use a filter operator to pass the emitted value only in case the current count of images in images.value is equal to 6 ā the maximum amount of photos in a collage.
-
Use a flatMap to display an alert letting the user know they reached the maximum photos and wait until they tap the Close button.
-
Use a sink(receiveCompletion:receiveValue:) to pop the photos view controller out of the navigation stack.
This subscription should, when the maximum number of photos for a collage is selected, pop the photos view controller automatically and take the user back to the main view controller:ā
Excerpt From: By Marin Todorov. āCombineā. Apple Books.
I tried playing with the end result by opening the āChallengesā folder provided.
- No Alert was shown
{
self.alert(title: āLimit reachedā, text: āTo add more than 6 photos please purchase Collage Proā)
} - It will pop the PhotosViewController only on the 7th photo tap, even when all photos selected is landscape.
Yes, and this is NOT corrected for v1.0.1. Is anyone on the team bothering to read these errata?
I tried playing with the end result by opening the āChallengesā folder provided.
- No Alert was shown
{
self.alert(title: āLimit reachedā, text: āTo add more than 6 photos please purchase Collage Proā)
}- It will pop the PhotosViewController only on the 7th photo tap, even when all photos selected is landscape.
Hey I believe the behavior youāre seeing here is correct regarding the popping of the VC.
Youāre only allowed to have 6 images so only when trying to tap a seventh image, youāll see a warning (since you already have 6).
The alert not showing was fixed in the latest version thatās in the store right now. Let me know if youāre still having any issues! Thanks
P.S. Weāve modified the text around this so itās a bit easier to consume. I hope thatāll clarify