Realm thread safe object with singleton
So I have a singleton class that manages the current user that is logged into my application. It looks like this class SessionManager { static let shared = SessionManager() var loggedInUser: User? } The problem is that if I want to get that user object from a background thread, I can't as I get the following exception: 'RLMException', reason: 'Realm accessed from incorrect thread.' After some googling I found Thread Safe Reference's. So I changed my class to be something like this instead: class SessionManager { static let shared = SessionManager() private var threadSafeUser: