page 106
onNext is Nothing
page 106
onNext is Nothing
First line of Page 64.
āIn a similar fashion to the subscribe operators, on(.next(_ 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ā.
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 thanks!
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.
.takeWhileWithIndex { image, index in index < 6 }
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
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ā
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.