Group Group Group Group Group Group Group Group Group

Beginning Table Views · Challenge: Creating More Rows | Ray Wenderlich


#1

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5995-beginning-table-views/lessons/7

#2

I think there’s a bit of a mismatch between the instructions for the challenge and the ways they’ve been executed in this video.

The ask is to populate the list with the logic:
indexPath.row % 5 ==0
indexPath.row % 5 ==1
indexPath.row % 5 ==2
indexPath.row % 5 ==3
indexPath.row % 5 ==4

But the example is completed with the logic:
indexPath.row % 5 ==0
indexPath.row % 4 ==0
indexPath.row % 3 ==0
indexPath.row % 2 ==0
indexPath.row % 1 ==0

Both work, but the results will turn out differently if anyone is comparing the results. Might want to switch one to match the other just so beginners aren’t scratching their heads trying to figure out why their results look different. :slight_smile:


#3

Thanks for the heads up. I’ve added an author’s note to correct the issue.


#4

Hello @bdmoakley
sorry but I can’t understand this masmatic way to print this 5 string values to 1000 Cell?
It will be fine to Explain it a bit to me :slight_smile:
also we can use the Array instead this magmatic way?


#5

Hi Hussien, I’m not quite sure I understand what you mean. Would you please clarify? Note, we do use arrays later in the course. This is just to get you started. After all, we walk before we can run. :]


#6

yeah thanks I understood you now


#7

The main issue is actually that the video before this one leaves us with the numberOfRowsInSection method returning 1 and this video starting with asking us to increase it from 5 to 1000.
Having done this in the book as well I recall something similar but maybe there is a bit of confusion between the videos.

Maybe if you update it you could include the upcoming Swift 5 feature of "indexPath.row.isMultiple(of: Int) :slight_smile:


#8

Ah I see - something looks like it was dropped here. I’ll re-review post WWDC 2019. We may reassess the approach of this course. More to come! :slight_smile: