Closed ikesyo closed 8 years ago
I think it's the users' choice of which using @objc(name)
or naming ModuleName.ClassName
in model editor.
As said in #21, force the user to make a not standard operation, as you propose, is not a solution of the problem but an alternative of @objc(className).
I think that having multiple solutions could make only confusion and make support more difficult.
The main task should be to help the developer and reduce the workload in an easy, clear and cleaver way.
@michaelarmstrong what do you think?
Thanks anyway
In Swift, classes are name-spaced in a module. So naming ModuleName.ClassName
in xcdatamodel is not a not standard operation. Because ModuleName.ClassName
is a fully qualified class name, it is required operation for Swift nature.
How do you think?
I think it not standard because in Xcode 6.2 if you create an Entity and set his name to whatever you want you have to remember to add ModuleName in xcdatamodel
I think for iOS 8 and Swift from a style point of view its better to use ModuleName than @objc, however, this Framework does support iOS 7 and ModuleName wasn't working properly when I first created it. Its not enforced what people use (the unit test target is just to run tests, not to edit them). As a user, you can use any you like.
I think we should have some proposals here on how to move forward.
I think for iOS 8 and Swift from a style point of view its better to use ModuleName than @objc,
Sure, me too but in this way you break the portability with older project without solving the problem at 100, maybe 90%.
Maybe we should wait and try with Swift 1.2 or greater
Sorry for the confusion :sweat: , but what I'd like to say was:
Just using NSStringFromClass(self)
as is forces the users to use @objc
, and they can't use FQCN for their entities. If we use NSStringFromClass(self).componentsSeparatedByString(".").last!
as a entity name in the code base, we can support the both options and the users can choice which option to use.
Excuse me for my lack of considering about changes in Xcode 6.2 (is there any changes for Core Data entity handling?) or iOS 7/8 compatibility issues :bow:
I pushed reverting changing entity name definition in tests. 0f69564 and bc24950 both pass the test suites. So we can safely support the both options I think.
This is a good news, let's think about!
@michaelarmstrong, what do you think?
Hate to dig this up again, but whats the current state of this?
It seems to satisfy these requirements, if true then it can be merged:
Class names in xcdatamodel (model editor) should be named like
ModuleName.ClassName
.Hopefully fixes #21.