[Warning: rambling]

In Objective-C, you pretty much have to use a class for you model (in your MVC 
Cocoa app). But in Swift, you have the option to use a struct/enum or a 
non-NSObject class too.

My model in mind is dumb data, so a struct seems appropriate.  But your various 
Cocoa subclass would need to reference the model, and using a struct means it’s 
by value instead of reference, so coordinating changes would get harder.

I’m guessing that I could use something like view-models, and only those VMs 
access the model, and always through referencing the containing object (like a 
NSDocument subclass).  But a reference type, even a non-NSObject one, still 
seems easier.  And I may want to use KVO or Core Data, which require NSObject 
subclasses.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to