I have an issue with realm for my iOS app. I previously used Firestore, which worked fine, but it became troublesome after using it. I'be incorporated Realm and I'm trying to get the user's details through a series of "Register" View controllers. Basically, I'm collecting their data via each view controller.
I commit at the the start of the registration(when they have been authenticated through google or apple sign in), which commits their email, first name,last name(through google or apple login) and their location. Then through of series of view controllers I collect more data to be stored onto the same row in realm db. The data added to the AuthenticationViewController after gets posted on an unrelated row or not at all. The data below (realmUser.firstname etc) gets posted in a row exactly as I intended. I know I shouldn't be committing from the start but I'm unsure how to work around it.
realmUser.firstName = firstName
realmUser.secondName = secondName
realmUser.id = emailId
realmUser.longitude = userlocation.longitude
realmUser.latitude = userlocation.latitude
do {//commit changes to realm db
try realm.write{
realm.add(realmUser)
}
} catch {
print("Error \(error)")
}