Raywenderlich.com Table Views Course Part 3

 Third - and final - part! After this, I will do a consolidation entry, using the same concepts but different content - Harry Potter characters. I know this is repetitive, but I don't care as this blog is purely for me (ha!) but it will be really useful to apply what I learn on this course IMMEDIATELY afterwards. Another great thing with rw.com is that the courses are up to date! Mark's were around 3 years old, so I was conscious of how dated the content was. Anyway, Catie's course has been difficult to follow at times but well-explained throughout. When I do the consolidation, I will need to have her course at hand, rather than just plough through! As always, I will try it myself first before checking out her info. Anyway enough rambling!


OK the first point in the intro is the delegates we're using are fine for an app that doesn't have interaction... but that's going to change! IOS 13 has brought out a new one - UITableViewDiffableDataSource. Nice! It sounds like a clever delegate. Have to conform to hashable and equatable. It's an instance of a class...


TableViewDiffableDataSource

Lots of code to add to the 'Library' file - was typing it but after 10 minutes gave up and copied/pasted the rest from download!

A note about 'hashable' - works well with structs. With class, you will need to add in additional code...interesting!

Another thing I've noticed is when conforming to protocols/delegates, Catie tends to do these one at a time, as extensions. Makes the code neater and more specific. 

OK, so the 'model' work is done. For the 'controller' work, LVC will need to have a dataSource property. Hashable and equatable - to compare items then to make changes etc.

WOW....intense 10 minute video that took more like an hour! My brain is fried.... but I'm not giving up. I just need to try my best to absorb this. 

Will be back later!

OK next bit! The diffable data bit was tough but I'm continuing - 2 more videos to go through. 

Add and Delete Rows

Again, specific methods, code etc. needed.  Can't figure out why it won't let me back to that screen...something about the segue or connections but I don't think I missed anything...


OK having wasted half an hour or so trying to solve it I give up! I've copied and pasted Catie's Main storyboard that seems to work to my Xcode project - that seems to be the neatest way of dealing with it, if a little bit of a shame not to have solved it! Anyway, all good. Last bit!


Move Rows

More methods needed...of course there are! So this is to manually click up and down and around to make the rows jump around. 

Course complete! Not going to go into any more detail now other than to say the last bit was to have options to sort the information by - title/author/ReadMe. 

Next time it will be consolidation part 1 with my own app. Cool!







Comments

Popular posts from this blog

Coursera Introduction to Programming in Swift - Part 4

Coursera - Intro to IOS Development Part 1