SlackTextViewController icon indicating copy to clipboard operation
SlackTextViewController copied to clipboard

Supporting an input bar that requires a different design

Open sibljon opened this issue 9 years ago • 7 comments

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.textInputbar to be specified in a SLKTextViewController initializer
  • Reduce the amount of interaction between SLKTextInputbar and SLKTextViewController and 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 SLKTextViewController is meant to be subclassed, it seems to make sense that the SLKTextViewController subclass interact directly with the input bar (examples: callbacks on button presses, text changing) and not be included in the protocol.
  • Keep SLKTextInputbar for those who don't need a custom design. If we did so, we'd also want a SLKTextViewController subclass that knows how to interact with SLKTextInputbar.

sibljon avatar Jan 14 '16 00:01 sibljon

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?).

dzenbot avatar Jan 25 '16 18:01 dzenbot

Hi.

is it simply possible for now to use custom version of SLKTextInputBar?

BBurzec avatar Feb 15 '17 15:02 BBurzec

Not currently @BBurzec, sorry.

dzenbot avatar Feb 15 '17 19:02 dzenbot

The ability to specify a custom input view (and even change it dynamically) would be very cool.

wlisac avatar May 27 '17 03:05 wlisac

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?

EdenShapiro avatar Oct 17 '17 20:10 EdenShapiro

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.

canpoyrazoglu avatar Nov 26 '17 09:11 canpoyrazoglu

absolutely the same situation. Unfortunately I can not use it because I need a different design

Ashotych avatar Dec 20 '17 12:12 Ashotych