TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2016 |
SPMSupports SPM | ✗ |
Maintained by Yinglun Duan.
NoChat is a Swift lightweight chat framework base on Chatto.
Along with NoChat, there are three companion frameworks: NoChatTG, NoChatMM, NoChatSLK.
These companion frameworks are just different user interface, you can custom your own with NoChat :].
Import the framework you want to use
import NoChat
You can create a subclass of ChatViewController
, and provide the data.
class TGChatViewController: ChatViewController {
// ...
override func viewDidLoad() {
inverted = true
super.viewDidLoad()
}
// Setup chat items
override func createPresenterBuilders() -> [ChatItemType: [ChatItemPresenterBuilderProtocol]] {
return [
DateItem.itemType : [
DateItemPresenterBuider()
],
MessageType.Text.rawValue : [
MessagePresenterBuilder<TextBubbleView, TGTextMessageViewModelBuilder>(
viewModelBuilder: TGTextMessageViewModelBuilder(),
layoutCache: messageLayoutCache
)
]
]
}
// Setup chat input views
override func createChatInputViewController() -> UIViewController {
let inputController = NoChatTG.ChatInputViewController()
// ...
return inputController
}
// ...
}
And I also suggest you custom the view controller of chat with the protocols provide by NoChat. I mean you can write your own ChatViewController
without NoChat.ChatViewController
. Source code is mind, not just code, I think.
The architechture of the chat UI looks like this:
See the Demo project inside.
Why call it NoChat
? Because the boss let us write many apps with chat UI, sorry I really don’t want to write chat UI anymore
Source code is distributed under MIT license.