Chapter 16 Lists Data model

Why do we need to create the data model file using Cocoa Touch class? Why can’t we use the Swift file and make it a subclass of NSPbject?

You can, if you wanted to :slight_smile: There’s generally more than one way of doing things. So the book shows you the different ways as you progress through it - doesn’t mean that you have to do it exactly as the book says. You can certainly do it a different way if you want to. Using Cocoa Touch class saves a little bit of typing since you don’t have to add the boilerplate for extending NSObject.

Thank you very much, very clear explanation:ok_man:t2:.

This topic was automatically closed after 166 days. New replies are no longer allowed.