Created
January 3, 2020 05:17
-
-
Save Krishna21Soni13/58f48dacf13d1d3d24d3458a720aa56f to your computer and use it in GitHub Desktop.
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
import Foundation | |
final class MessageViewModel { | |
var arrMessage: KxSwift<[Message]> = KxSwift<[Message]>([]) | |
func getMessagesFromServer() { | |
SocketHelper.shared.getMessage { [weak self] (message: Message?) in | |
guard let self = self, | |
let msgInfo = message else { | |
return | |
} | |
self.arrMessage.value.append(msgInfo) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment