Skip to content

Custom Realm support on sync #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 28, 2019
Merged

Custom Realm support on sync #108

merged 3 commits into from
Jan 28, 2019

Conversation

raullermen
Copy link
Contributor

@raullermen raullermen commented Jan 21, 2019

Hello @caiyue1993,

I had crashing problems when tried to use my custom Realm (schema versioning issues), so I needed to pass my Realm reference to SyncEngine.
I believe this problem is related to #86 and may can resolve issue #17.

Second, SyncEngine was ignoring my In64 list, so I made a slight modification on the Int list conversion.

Check if these modifications fits your design vision.

And thanks for the great work on this project!

@caiyue1993 caiyue1993 self-assigned this Jan 23, 2019
@caiyue1993
Copy link
Owner

caiyue1993 commented Jan 27, 2019

Hi @raullermen , thanks for your contributions. And I've appended some changes:

  1. Remove the Cream class
  2. Set the default realm to try! Realm() so that the code gets clean
  3. Add realm parameters to each SyncObject class, too. However, the realm parameter's priority on the SyncEngine is higher than SyncObject, which means once set the realm value on SynEngine will take effect on each SyncObject.

Take a look if you have time. And this pr is gonna be merged. Thanks!

@raullermen
Copy link
Contributor Author

raullermen commented Jan 27, 2019

Hi @caiyue1993
Very good! Indeed it got cleaner.
Glad i can help.

@caiyue1993 caiyue1993 merged commit edd4b56 into caiyue1993:master Jan 28, 2019
Rifmovnik added a commit to Rifmovnik/IceCream that referenced this pull request Apr 13, 2019
* commit 'afebc8a0883d9724a6adda263d5110eb833634d0': (43 commits)
  Fix typo
  bump version
  Removed cream.swift reference in xcodeproj
  bump version number to 1.8.0
  add 1.7.2 & 1.8.0 in CHANGELOG
  add support for the conversion of recordID to Int type primaryKey
  make parseFromRecord method static
  Custom Realm support on sync (caiyue1993#108)
  weak self to avoid potential retain cycle
  Allow SyncEngine to use custom CKContainers (besides default)
  use guard statement instead
  set default `shouldOverwrite` value to true
  Update CreamAsset.swift
  Add support for overwrite prevention; object id init
  Make guard statement one line
  Revert the changes of CreamAsset
  Mark save func as private and use FileManager
  Use break and continue correctly
  Update README.md
  Resolve `cannot use an empty list to initialize a new field`
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants