Chatto icon indicating copy to clipboard operation
Chatto copied to clipboard

Could you make it possible to update chatItemPresenter factory after BaseChatViewController's viewDidLoad?

Open PiotrDabrowskiSTP opened this issue 6 years ago • 1 comments

I am working on a functionality that would require changing chatItemPresenter font after some user interaction on the view controller.

This is completely easy but the chatViewController is only asked to set the presenterFactory (ChatItemPresenterFactoryProtocol) once on the viewDidLoad execution which means it will not change unless we re-show it completely again.

I tried to access baseChatViewController's presenterFactory from its subclass but it's not a public property so it failed. I then thought of overriding public method createPresenterForChatItem(_ chatItem: ChatItemProtocol) but it is declared in baseChatViewController's extension which makes it impossible.

So therefore I would like to ask if one of the following would be possible to add in one of the upcoming releases:

  1. Adding a public method that could trigger reloading presenterFactory for a chatViewController that could contain parts like: self.presenterFactory = self.createPresenterFactory() self.presenterFactory.configure(withCollectionView: self.collectionView) that we could trigger on-demand after baseChatViewController's viewDidLoad.
  2. Moving public func createPresenterForChatItem(_ chatItem: ChatItemProtocol) outside of extension declaration.
  3. Making chatViewController's presenterFactory public.

I am of course aware options 2 and 3 aren't perhaps the most wanted but at least allowing trigger option 1. on developer demand might help some users among which I founded myself already.

Thank you in advance!

PiotrDabrowskiSTP avatar Apr 10 '18 14:04 PiotrDabrowskiSTP

OMG, I was looking was this. end up to find the same person going through the same thing

shungz89 avatar Oct 16 '18 04:10 shungz89