Skip to content

Instantly share code, notes, and snippets.

@mischa-hildebrand
Last active October 24, 2018 16:19
Show Gist options
  • Save mischa-hildebrand/85ed3695a38c2f821a53f97d52c6082e to your computer and use it in GitHub Desktop.
Save mischa-hildebrand/85ed3695a38c2f821a53f97d52c6082e to your computer and use it in GitHub Desktop.
MessageDataStore
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