objectbox / objectbox-swift

Swift database - fast, simple and lightweight (iOS, macOS)
https://swift.objectbox.io
Apache License 2.0
465 stars 30 forks source link

Module compiled with Swift 5.0.1 cannot be imported by the Swift 5.1 compiler: #17

Closed daoan1412 closed 5 years ago

daoan1412 commented 5 years ago

Module compiled with Swift 5.0.1 cannot be imported by the Swift 5.1 compiler: With Xcode 11 GM seed 2

greenrobot commented 5 years ago

@daoan1412 Which version did you test with?

daoan1412 commented 5 years ago

with ObjectBox version 1.0.0-rc.7'

uli-objectbox commented 5 years ago

We've built an rc10 with Swift 5.1. You can get it by adding

source 'https://github.com/objectbox/objectbox-swift-spec-staging.git'

to the top of your Podfile and asking for the version 1.0.0-rc.10.

Note that this release contains a number of API changes (this is the last chance we have to make source-incompatible changes, so we've taken a hard look at everything once more and improved a few things). Here's a short list of the changes from previous betas:

  1. isEmpty(), count(), all(), sum(), min(), max() etc. are now functions to make it clearer they may perform a database lookup and aren't just properties to read.
  2. putImmutable() is now gone. Just call put() instead, it now returns the IDs like putImmutable used to.
  3. The old Id<> type has been renamed to EntityId<>. There is now a new Id type that does not use generics.
  4. Changes to standalone relations need to be saved explicitly using a call to applyToDb().
  5. Most calls have been revised to now throw errors, so you'll have to add the requisite try statements.
  6. ToMany has been revised to no longer need the containing type as a second generic parameter, so change any ToMany<A, B> in your code to ToMany<A>.

We hope this will tide you over until 1.0 proper releases.

uli-objectbox commented 5 years ago

Please let us know if this resolves things for you, or if you have any other issues with it.

daoan1412 commented 5 years ago

Now It works on xcode 11. Thanks for your support.