mongodb / stitch-ios-sdk

Apache License 2.0
42 stars 25 forks source link

Use of unresolved identifier 'DefaultConflictHandlers', Version 5.0.0 #150

Closed robert-cronin closed 5 years ago

robert-cronin commented 5 years ago

I am following the Build a Mobile App With Sync tutorial MongoDB provides but running into an error when configuring the sync on a particular collection. This is my code:

todoCollection.sync.configure(
    conflictHandler: DefaultConflictHandlers.remoteWins.resolveConflict,
    changeEventDelegate: { documentId, event in
        if !event.hasUncommittedWrites {
            // you can add code here to update your app's UI or
            // perform other operations based on a document change.
        }
}, errorListener: self.on)

These are my imports:

import MongoSwift
import StitchCore
import StitchRemoteMongoDBService

And for clarity's sake, here is the error in Xcode:

Screen Shot 2019-03-12 at 2 17 57 pm

I have some theories, like a separate import required or my Xcode indexing is just broken, but no success so far.

robert-cronin commented 5 years ago

Looks like the class has been renamed to DefaultConflictHandler in this example? Or perhaps I'm just not able to find DefaultConflictHandlers

robert-cronin commented 5 years ago

problem solved on stackoverflow

dkaminsky commented 5 years ago

Looks like the tutorial may need tweaking. I’ve reported this to our documentation team for investigation. I’m glad you found a solution in the meantime. Please continue to reach out with questions/concerns/bugs.