Last active
October 24, 2018 16:19
-
-
Save mischa-hildebrand/85ed3695a38c2f821a53f97d52c6082e to your computer and use it in GitHub Desktop.
MessageDataStore
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
class MessageDataStore: DataStore { | |
/// A singleton object. | |
static let shared = MessageDataStore() | |
/// The web socket for network communication. | |
private var webSocket: WebSocketClient? | |
/// The delegate is informed whenever new messages arrive. | |
weak var delegate: DataStoreDelegate? | |
/// Array to keep all conversations in memory. | |
private var conversations: [Conversation] = [] | |
// ... | |
// Implementation | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment