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: Access Control ā€” The Swift Programming Language (Swift 5.7)

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.