Created
October 1, 2016 13:50
-
-
Save doluvor/c2db8b60e6ca92353db109ce8f8280d9 to your computer and use it in GitHub Desktop.
Set default Realm for user
This file contains 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
func setDefaultRealmForUser(username: String) { | |
var config = Realm.Configuration() | |
config.fileURL = config.fileURL!.deletingLastPathComponent().appendingPathComponent("\(username).realm") | |
Realm.Configuration.defaultConfiguration = config | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment