Beginning Collection Views · Inserting Cells | raywenderlich.com


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

why must we use objc code?

You are calling addTarget and you are passing in a method to be called. AddTarget is written all with Objective-C. With Swift 4, Objective-C can’t access our Swift methods and objects by default. So we need to annotate our methods and objects with @objc - This lets Objective-C see it, and thus, we can pass it into Objective-C code. I hope that helps!

@bdmoakley, just had to give a comment. I’ve been going through the beginner iOS and Swift learning path for a couple weeks now, and this particular section has been a breath of fresh air. I was getting a bit frustrated with some of the previous lectures and challenges as things would just pop up without real explanation. This results in simply copying what the instructor is doing and not really learning.

I understand from the feedback from some of the other instructors such as @jessycatterwaul that the learning path is fairly new, so some of the courses are perhaps not as orderly in terms of a progression from course to course, and that this will likely be addressed in future iterations of these lectures.

That said, I feel that this Collection Views course has been fantastic. Your pacing is very good, and your explanations are beginner friendly. I really like when you refer to previous courses such as tableviews as it helps to solidify the process in my mind. Even the small explanations such as when you indicate, “I understand that it would make sense if you could define the number of columns in interface builder, but it has to be done in code - and here’s how”. This really shows you are putting yourself in our shoes, and really showing us why we are doing what we are doing, instead of just saying ‘do this’. Further, your explanations of each method we are using, and even the challenge where we needed to check the documentation were really helpful.

I feel like I’m getting a lot out this course in particular, and it’s refreshing as I was getting pretty close to dropping the learning path completely.

I read the comments on all the videos I watch. I know some people have commented on ways that the code could be more flexible - especially in regards to the column widths, etc, however, I personally appreciate that the approach has been to keep focus on the topic at hand, and not get bogged down on how a particular component is calculated. Code, like all writing goes through edits. I much prefer to understand how and why things are happening than be shown how clever we can all be with the latest little method which is hard to read. An example would be from the 'Mastering AutoLayout" where the decision is to use the Dictionary for (key, value) in zip(keys, values) just for the sake of it.

1 Like

@chuck_taylor Thank you for your feedback - much appreciated! :]

Hi Chuck, thank you very much for the nice note. I do appreciate it. Feedback is always important as it helps us improve the course in future iterations. I think the Collection Views is one of those course that could help with a good re-think, but I’m glad you found the continuity between the table views and collection view to be helpful.

In any case, thanks so much and I hope you are enjoying all the courses. Cheers!