I'm building a Core Data application using Swift 3 and Xcode 8 beta and when I generate the NSManagedObject subclasses Xcode gives me Objective-C files instead of Swift.
While I am very aware that I can simply write my own NSManagedObject subclasses in Swift I'd like to know how to switch the language of the generated code from Objective-C to Swift.
How can I generate NSManagedObject classes in Swift instead of Objective C in Xcode 8?
From the Xcode menu bar, choose Editor > Create NSManagedObject Subclass. Select your data model, then the appropriate entity, and choose where to save the files. Xcode places both a class and a properties file into your project.
In some respects, an NSManagedObject acts like a dictionary—it's a generic container object that provides efficient storage for the properties defined by its associated NSEntityDescription instance.
A managed object context represents a single object space, or scratch pad, in a Core Data application. A managed object context is an instance of NSManagedObjectContext . Its primary responsibility is to manage a collection of managed objects.
Alright, apparently I didn't look hard enough, it's right here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With