Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate NSManagedObject classes in Swift instead of Objective C in Xcode 8?

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.

Question

How can I generate NSManagedObject classes in Swift instead of Objective C in Xcode 8?

like image 354
Dan Beaulieu Avatar asked Jul 10 '16 01:07

Dan Beaulieu


People also ask

How do I make a NSManagedObject subclass in Xcode 13?

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.

What is NSManagedObject in ios?

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.

What is managed object in Core data?

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.


1 Answers

Alright, apparently I didn't look hard enough, it's right here:

enter image description here

like image 73
Dan Beaulieu Avatar answered Oct 05 '22 14:10

Dan Beaulieu