-
Notifications
You must be signed in to change notification settings - Fork 594
BaseChatViewController
Diego Sánchez edited this page Jul 4, 2016
·
1 revision
The base UIViewController you must subclass
Needs an input bar:
public func createChatInputView() -> UIView {
assert(false, "Override in subclass")
return UIView()
}
Needs a Data source:
public final func setChatDataSource(dataSource: ChatDataSourceProtocol?, triggeringUpdateType updateType: UpdateType?) {
...
}
Needs to know how to create Presenters for your ChatItems:
public func createPresenterFactory() -> ChatItemPresenterFactoryProtocol {
// Default implementation
return ChatItemPresenterFactory(presenterBuildersByType: self.createPresenterBuilders())
}
If you stick to the default implementation then you must override createPresenterBuilders
public typealias ChatItemType = String
public func createPresenterBuilders() -> [ChatItemType: [ChatItemPresenterBuilderProtocol]] {
assert(false, "Override in subclass")
return [ChatItemType: [ChatItemPresenterBuilderProtocol]]()
}