Git Product home page Git Product logo

Comments (4)

AliSoftware avatar AliSoftware commented on May 17, 2024

Great idea! 👍

Don't hesitate to make a PR to create a DataModelParser that could do that 😉

from swiftgen.

AliSoftware avatar AliSoftware commented on May 17, 2024

If you don't feel confortable creating the code, at least I'd be interested to see what you imagine the generated code be like (you could even for example propose a Stencil template):

  • Will it be an enum per NSManagerObject, with one case per attribute?
  • Or one struct per NSManagedObject containing an enum attributes with one case per attribute, and an enum relationships with one case per relationship?
  • Will it be useful to generate an enum for other properties as well, like its nullability, its type, etc?
  • Will it be useful to generate some static var myAttribute: String (if the myAttribute is of type String) for each attribute ?

Would be very interested in your feedback (especially since it has been some time I haven't used CoreData, as for my latest projects I'm more used to play with Realm instead, so I've probably lost my touch on that)

from swiftgen.

 avatar commented on May 17, 2024

Consider use of following property when creating NSFetchRequest where we have to pass attributes names as strings in array. So I think enum per NSManagedObject with one case per attribute/relationship will be fine.

@property (nonatomic, copy) NSArray *propertiesToFetch NS_AVAILABLE(10_6, 3_0);

from swiftgen.

djbe avatar djbe commented on May 17, 2024

#455 has been merged, which implements this feature. I'd like to thank everyone who participated in this issue and the PRs leading up to this.

We'll probably do a release this weekend. In the meantime, people who'd like to try this feature can check out the develop branch,

from swiftgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.