How can I maintain core data in iOS 7 and iOS 8 using namespacing?

I would like to support both iOS 7 and iOS 8 if possible. I am writing an application in Swift. While setting up the master data, I found that you need to omit the spaces in your model classes. Otherwise the class was not found (i.e. Target.Class vs Class). The namespace requirement is a problem here for several reasons. First, it means you cannot use your data model for different purposes (including testing purposes) and two, it breaks backwards in iOS 7. iOS 7 looks for a class, but now the data model has Target.Class.

Does anyone know a suitable way to support iOS 7 and iOS 8 in this situation? I have come across other areas where the naming issue has occurred.

+3


source to share


1 answer


Adding the @objc tag to your custom class declaration will have the additional impact of moving it to the default namespace, which is not manipulable, so it can be used for both iOS 7 and 8.



+3


source







All Articles