Created
June 22, 2017 13:24
-
-
Save michael-mckenna/c164bfb3d316c9cc90ee7b792bce62ce to your computer and use it in GitHub Desktop.
Realm User Session for Non Admin not completing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SyncUser.logIn(with: credentials, | |
server: RealmURL.authentication, | |
timeout: 10) { user, error in | |
if let user = user { | |
print("Successfully signed in.") | |
let appDel = UIApplication.shared.delegate as! AppDelegate | |
appDel.initializeRealmConfigs() | |
let _ = RealmHelper.getRealmFor(configuration: RealmConfig.userObjectRealm!) | |
guard let session = user.session(for: RealmURL.userObjects) else { | |
return | |
} | |
self.token = session.addProgressNotification(for: .download, mode: .forCurrentlyOutstandingWork) { progress in | |
if progress.isTransferComplete { /******* This line is never hit *******/ | |
self.token?.stop() | |
DispatchQueue.main.async { | |
self.removeActivityIndicator() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment