Skip to content

Use latest RealmSwift - #256

Open
leoz wants to merge 60 commits into
caiyue1993:realm-latestfrom
leoz:master
Open

Use latest RealmSwift#256
leoz wants to merge 60 commits into
caiyue1993:realm-latestfrom
leoz:master

Conversation

@leoz

@leoz leoz commented Jan 20, 2022

Copy link
Copy Markdown

Use latest RealmSwift v10.21.1.
Example was updated, tested and seems to be working.

@caiyue1993

caiyue1993 commented Jan 20, 2022

Copy link
Copy Markdown
Owner

Hi @leoz, thanks for the PR and looks nice! I'll look into it and consider the compatible plan. Appreciate for the hard work!

@leoz

leoz commented Jan 20, 2022

Copy link
Copy Markdown
Author

@caiyue1993 , no worries. Thank you for the awesome job creating this package!

@brightspread

Copy link
Copy Markdown

There is a problem with archiving Realm 10.7.7 version on Xcode 13. Please consider to merge this commit.

@leoz

leoz commented Feb 5, 2022

Copy link
Copy Markdown
Author

Hey @caiyue1993 , could you please share the plan of integrating the support for the recent realm? Is there anything I could help with?

@jshrager

jshrager commented Feb 7, 2022

Copy link
Copy Markdown

Any updates on this? I have been unable to archive my app for the past few months. I couldn’t archive until I upgraded Realm then when I did that I got an IceCream error!

@kleber-maia

Copy link
Copy Markdown

I'd suggest everyone to just reference this PR's commit directly until it gets merged into master.

@halzo826

Copy link
Copy Markdown

I'm using machine language translation, so sorry for the weird English!
ListBase has been removed in the latest version of Realm, but if you just want to get the Count or contents of a List, you can use RLMSwiftCollectionBase.

Specifically, you can use the following
CKRecordConvertible.swift
/// We may get List here
/// The item cannot be casted as List
/// It can be casted at a low-level type ListBase
guard let list = item as? RLMSwiftCollectionBase, list._rlmCollection.count > 0 else { break }
var referenceArray = CKRecord.Reference
let wrappedArray = list._rlmCollection

@leoz

leoz commented Feb 10, 2022

Copy link
Copy Markdown
Author

I'm using machine language translation, so sorry for the weird English! ListBase has been removed in the latest version of Realm, but if you just want to get the Count or contents of a List, you can use RLMSwiftCollectionBase.

Specifically, you can use the following CKRecordConvertible.swift /// We may get List here /// The item cannot be casted as List /// It can be casted at a low-level type ListBase guard let list = item as? RLMSwiftCollectionBase, list._rlmCollection.count > 0 else { break } var referenceArray = CKRecord.Reference let wrappedArray = list._rlmCollection

@halzo826, good point! This change is already included in this CR. Thank you very much!

@jshrager

Copy link
Copy Markdown

I'd suggest everyone to just reference this PR's commit directly until it gets merged into master.

Can you guide me on how to do this? I’m currently integrating IceCream via Cocoapods - presumably I should remove this in my Podfile then download this pull request and just copy the files in manually?

@kleber-maia

kleber-maia commented Feb 17, 2022

Copy link
Copy Markdown

I'd suggest everyone to just reference this PR's commit directly until it gets merged into master.

Can you guide me on how to do this? I’m currently integrating IceCream via Cocoapods - presumably I should remove this in my Podfile then download this pull request and just copy the files in manually?

I don't think you can achieve that with Cocoapods. The manual way you described should work. In my case, since I'm using Swift Packages, it's pretty seamless: just provide the commit's SHA in the dialog box.

image

@jshrager

Copy link
Copy Markdown

Oh perfect, will remove via Cocoapods and try and add back in as a package. I’m sure I can get that working.

just to confirm, that will then build ok using the latest realm?

@kleber-maia

Copy link
Copy Markdown

Oh perfect, will remove via Cocoapods and try and add back in as a package. I’m sure I can get that working.

just to confirm, that will then build ok using the latest realm?

If you add IceCream via Swift Packages, you may as well remove Realm from Cocoapods / elsewhere. Since Realm is a "sub-dependency", Xcode will install Realm 10.21.1 and keep it updated according to IceCream package definitions.
At least, this is what I did, since I don't want to use a newer version of Realm not tested with IceCream.

@leoz leoz changed the title Use latest RealmSwift v10.21.1 Use latest RealmSwift v10.22.0 Feb 26, 2022
@leoz

leoz commented Feb 26, 2022

Copy link
Copy Markdown
Author

Updated with latest realm-swift v10.22.0.

@leoz leoz changed the title Use latest RealmSwift v10.22.0 Use latest RealmSwift v10.23.0 Mar 2, 2022
@leoz

leoz commented Mar 2, 2022

Copy link
Copy Markdown
Author

Updated to RealmSwift v10.23.0. Example app works fine.

@leoz leoz changed the title Use latest RealmSwift v10.23.0 Use latest RealmSwift v10.24.0 Mar 7, 2022
@leoz

leoz commented Sep 25, 2022

Copy link
Copy Markdown
Author

@caiyue1993 , Great! Thank you!
Just changed the base branch to "realm-latest".

@leoz

leoz commented Oct 5, 2022

Copy link
Copy Markdown
Author

@caiyue1993 , anything you would like me to change to get this merged into the branch?

@leoz leoz changed the title Use latest RealmSwift v10.30.0 Use latest RealmSwift v10.32.0 Oct 14, 2022
@leoz leoz changed the title Use latest RealmSwift v10.32.0 Use latest RealmSwift v10.32.2 Nov 7, 2022
@leoz leoz changed the title Use latest RealmSwift v10.32.2 Use latest RealmSwift v10.33.0 Dec 1, 2022
@leoz leoz changed the title Use latest RealmSwift v10.33.0 Use latest RealmSwift v10.34.0 Jan 14, 2023
@leoz leoz changed the title Use latest RealmSwift v10.34.0 Use latest RealmSwift Feb 9, 2023
@kushsolitary

Copy link
Copy Markdown

@leoz thank you for this PR!

@kleber-maia

kleber-maia commented Jun 8, 2023

Copy link
Copy Markdown

After Apple's SwiftData announcement, is anyone else considering migrating away from Realm + IceCream? 😅 Their statements and the WWDC videos look damn promising. 🚀

Create models with Swift
Model your data using regular Swift types with @model, with no additional files or tools to manage. SwiftData can automatically infer many relationships and you can use clear declarations like @Attribute(.unique) to describe constraints. Like SwiftUI, the source of truth is in your code.

Automatic persistence
SwiftData builds a custom schema using your models and maps their fields efficiently to the underlying storage. Objects managed by SwiftData are fetched from the database when needed and automatically saved at the right moment, with no additional work on your part. You can also take full control using the ModelContext API.

CloudKit syncing
Your data can be stored in files using DocumentGroup and synced via iCloud Drive, or you can use CloudKit to sync data between devices.

@dbmrq

dbmrq commented Jun 8, 2023 via email

Copy link
Copy Markdown
Contributor

@faizy-ahmed

Copy link
Copy Markdown

I'm using machine language translation, so sorry for the weird English! ListBase has been removed in the latest version of Realm, but if you just want to get the Count or contents of a List, you can use RLMSwiftCollectionBase.

Specifically, you can use the following CKRecordConvertible.swift /// We may get List here /// The item cannot be casted as List /// It can be casted at a low-level type ListBase guard let list = item as? RLMSwiftCollectionBase, list._rlmCollection.count > 0 else { break } var referenceArray = CKRecord.Reference let wrappedArray = list._rlmCollection

It worked for me, Thanks! @halzo826

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.