SlackTextViewController
SlackTextViewController copied to clipboard
Supporting an input bar that requires a different design
Currently, SLKTextInputbar offers a lot of functionality for a fairly specific design and layout. The design that I'm currently building against doesn't lend itself well to SLKTextInputbar's layout (for example: I have additional buttons below the text view, and want custom layout and animations far beyond what's currently possible), and thus, I've found myself forking SlackTextViewController. I'd just like to clarify up front that I'm just bringing this up for discussion. I understand that this may be completely out of the question, as this project was built for Slack's own needs.
What do folks think about abstracting SLKTextViewController's input bar further, such that it's easier to modify SLKTextInputbar for one's own purposes? Here is a proposed change:
- Allow
SLKTextViewController.textInputbarto be specified in aSLKTextViewControllerinitializer - Reduce the amount of interaction between
SLKTextInputbarandSLKTextViewControllerand abstract it to a protocol. Custom input bar classes can conform to that protocol. - This protocol's interface would try to cover the lowest-common-denominator of a messaging app. Off the top of my head, the input bar might only need to be able to specify its preferred height (there are many mechanisms to do so).
- Since
SLKTextViewControlleris meant to be subclassed, it seems to make sense that theSLKTextViewControllersubclass interact directly with the input bar (examples: callbacks on button presses, text changing) and not be included in the protocol. - Keep
SLKTextInputbarfor those who don't need a custom design. If we did so, we'd also want aSLKTextViewControllersubclass that knows how to interact withSLKTextInputbar.
This is an interesting idea, although abstracting SLKTextInputbar might be hard since its pretty tied to SLKTextViewController and SLKTextView.
We already do an abstraction for SLKTextView and the typing indicator, but this other one can be really hard to maintain and cover both side's edge cases too.
Nonetheless, you could try it out and we'll see how it goes.
FWIW, SLKTextInputbar deserves some refactoring to allow multiple button outlets, and a better way of adding them (UIButtonItem?).
Hi.
is it simply possible for now to use custom version of SLKTextInputBar?
Not currently @BBurzec, sorry.
The ability to specify a custom input view (and even change it dynamically) would be very cool.
So just to clarify: this is still no way to add additional buttons to the textInputbar or to alter its layout in a significant way, correct?
This is exactly the reason I (sadly) need to give up SlackTextViewController. My client simply requires a design with custom input bar that is impossible with the current library.
absolutely the same situation. Unfortunately I can not use it because I need a different design