RxSwift v1.0 Errata

page 106

onNext is Nothing

First line of Page 64.

“In a similar fashion to the subscribe operators, on(.next(_:slight_smile: is how you add a”

is missing ‘)’.

Page 70.

2. Add two elements onto the subject.

“two” has to be “three”

Simple typo on p. 60: “Use Xode’s autocompletion” should be “Xcode’s”. :slight_smile:

Page 223: Am I crazy or should elementsPerSecond be named secondsPerElement?

I see the Chapter 4, challenge source code solution is subscribing for onNext which should rightfully be for onCompleted, which is missing.

yeah, we noticed onNext/onCompleted got mixed up in the challenge code - it’s gonna be fixed in next edition :slight_smile: thanks!

:slight_smile:
Another point about Chapter 6 Pg 123 on using takeWhile together with self?.images.value.count ?? 0 ) < 6

We can also make use of takeWhileWithIndex that’s covered in the previous Chapter 5 as the last filter to limit the photo count, to avoid the direct property access that’s mentioned on page. :smile:

.takeWhileWithIndex { image, index in index < 6 }

1 Like

Keep them coming! That’s a great proposal

Challenge
04-observables-in-practice

func showMessage(_ title: String, description: String? = nil) {
alert(title: title, text: description)
  .subscribe(onNext: { [weak self] in
    self?.dismiss(animated: true, completion: nil)
  })
  .addDisposableTo(bag)

}

the onNext: Never be called why you need to put It there?

this has been addressed, will fix in the next edition :slight_smile:

Chapter 2 page 59.

factories that vend => send

Page 137 of print: grant-acecss-alert-box -> grant-access-alert-box

Chapter 7, Getting Started paragraph, there is reference to unicodeDescription(lowercased:). This isn’t found or used in any of the source, and, it’s also not discussed in Chapter 5. I presume this has something to do with example(of:)?

For Chapter 8 Challenge 2, may I suggest instead of convoluting the original

func fetchEvents(repo: String)

into doing more than it should (ignoring its input argument for that matter), we can suggest the reader to create a new function

func fetchTop5Repo() -> Observable<[String]>

that grabs the 5 repo full_name as required and feed it into func fetchEvents(repo: String). The coordination can be done in func refresh() and this should work for the challenge. :]

I was just reading through chapter 4 and on page 78 the book says to add two variables and then mark them as ‘private’ because no other class will be using them. I just wanted to point out that that is not the case.

The ‘private’ marker in Swift 3.0 marks an item as private to the module, which in this case means any other class in the module (project) can access them! To make them truly private for just that class they need to be marked as ‘fileprivate’ :slight_smile:

The apple docs disagree: https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html

My apologies! Looks like I misunderstood the change from private -> fileprivate and what private means now. Thanks for the link to the docs though!

If you’d like to know how the completed method looks at any point you can always have a look at the completed project. We can’t include the full source code for each file at every step as you can imagine.

I’m looking at the text and not sure what do you find confusing in that part? The text says “Scroll to the top of actionAdd() and alter the first subscription to newPhotos. For the first operator, insert a filter:”

I think a “before” got edited to “for” by mistake and we can fix that, but if you don’t get the expected behavior I can recommend either tracing back your steps through the tutorial or comparing with the completed project included in the chapter.

You also might wanna watch your tone, profanities aren’t generally accepted on these forums no matter if you delete your posts afterwards.