supermarin / ObjectiveRecord

ActiveRecord-like API for CoreData
MIT License
1.29k stars 194 forks source link

Is there a Swift version coming out? #109

Open funky-monkey opened 9 years ago

funky-monkey commented 9 years ago

I've been using your library for quite some time now and love it. Also fully made the transition to Swift. Can you tell me if and when there will be a Swift version coming out? I'd love use it! If you need testers for this let me know!

Cheers, Sidney

stephencelis commented 9 years ago

It's unlikely that ObjectiveRecord will ever become pure-Swift given that it has to piggyback on Core Data, which is not, though I guess I should never say "unlikely ever". The road to ObjectiveRecord being at the least more pleasant to use with Swift in the meantime:

  1. Rename where methods/functions to use something else, as this is a keyword in Swift.
  2. Release 2.0, which uses chaining and is a bit more friendly with dot-syntax Swift: https://github.com/supermarin/ObjectiveRecord/tree/2-0-experimental

Sadly, both our attentions have been elsewhere lately, but maybe @supermarin can weigh in more.

dglancy commented 9 years ago

I did make a start, but am time constrained too at the moment to finish it out. https://github.com/dglancy/SwiftRecord/tree/dg/dev

reaperdtme commented 9 years ago

Popped a SwiftRecord Working well afaik https://github.com/arkverse/SwiftRecord

stephencelis commented 9 years ago

@zaiddag Neat! Though couldn't you get rid off all that forced casting by using Self in those functions?

reaperdtme commented 9 years ago

@stephencelis sadly no. Calls to Core Data like NSEntityDescription.insertNewObjectForEntityForName return AnyObject. There is no support for casting into Self. It seems Self is only useful if you're using your class constructors. Also, there is no support for [Self] return types either.