Open leoz opened 2 years ago
Hi @leoz, thanks for the PR and looks nice! I'll look into it and consider the compatible plan. Appreciate for the hard work!
@caiyue1993 , no worries. Thank you for the awesome job creating this package!
There is a problem with archiving Realm 10.7.7 version on Xcode 13. Please consider to merge this commit.
Hey @caiyue1993 , could you please share the plan of integrating the support for the recent realm? Is there anything I could help with?
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!
I'd suggest everyone to just reference this PR's commit directly until it gets merged into master
.
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
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!
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'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.
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?
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.
Updated with latest realm-swift v10.22.0.
Updated to RealmSwift v10.23.0. Example app works fine.
Updated to RealmSwift v10.25.0. @caiyue1993 , FYI.
This PR solves the dependency problem, so why is there no merge yet?
https://github.com/realm/realm-swift/issues/7828#event-6787329095
RealmSwift 10.28.1 published
@hdcola , updated to RealmSwift 10.28.1. Check it out.
Hey @caiyue1993 , any chance we could merge it in?
Hey @caiyue1993 , any chance we could merge it in?
He told me , maybe we have a branch use 10.2x RealmSwift.
@hdcola , this is a great idea! We could make e.g. "master -> 4.x.x" (or whichever is stable) and create a new permanent branch e.g. "next -> 10.2x.x" and bump the pod version major there so both could be released independently. LMK, if you want me to move this to the branch.
@hdcola , this is a great idea! We could make e.g. "master -> 4.x.x" (or whichever is stable) and create a new permanent branch e.g. "next -> 10.2x.x" and bump the pod version major there so both could be released independently. LMK, if you want me to move this to the branch.
yes, this is a good idea
@caiyue1993 , could you please (if your are ok with the proposal above) create a new branch "next" off your "master" so I could update the pull request please?
@leoz Thank you. Update RealmRswift also solves this issue https://github.com/RxSwiftCommunity/RxRealm/issues/179
Hi there,
About the compatible
We have updated realm from 10.7.7 to 10.28.2. iCloud Sync seems ok.
And what we have learned is remember to keep using old style @objc dynamic
and func primaryKey() -> String?
.
@alfredcc , hey! I have updated an example app in this repo as well as my own project to use @Persisted
and @Persisted(primaryKey: true)
and did not notice any issue. What specific problem do you see?
@leoz, If we use @Persisted first, it's ok.
The issue is if we upgrade from @objc dynamic
to @Persisted
Or downgrade from @Persisted
to @objc dynamic
, data will broken
@alfredcc , I see. This makes sense. Thank you for heads up! :-)
Updated to RealmSwift 10.28.3
I want to make a copy of the inherited object as a temporary object. I want to use handyjson. I need to implement the initialization method of the class, but this causes icecream to not work when synchronizing table data for example: class Dog: Object,HandyJSON { @objc dynamic var id = NSUUID().uuidString @objc dynamic var name = "" @objc dynamic var age = 0 @objc dynamic var isDeleted = false
static let AVATAR_KEY = "avatar"
@objc dynamic var avatar: CreamAsset?
// Relationships usage in Realm: https://realm.io/docs/swift/latest/#relationships
@objc dynamic var owner: Person? // to-one relationships must be optional
override class func primaryKey() -> String? {
return "id"
}
required override init() {
super.init()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
@leoz can you help me,I don't know why
@GoodLuckBobe , will check in ~3 weeks. Traveling at the moment...
I was just curious about when this will be merged. any plan?
@caiyue1993 , could you create a new brunch in your repo named e.g. "next" or "realm-latest" so I could land this please finally?
Hey @leoz , realm-latest
branch has just been created.
Pre-congrats for the hard work!
@caiyue1993 , Great! Thank you! Just changed the base branch to "realm-latest".
@caiyue1993 , anything you would like me to change to get this merged into the branch?
@leoz thank you for this PR!
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.
Yes! 😍😍
Update us if you give it a try!
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
Use latest RealmSwift v10.21.1. Example was updated, tested and seems to be working.