We tried other popular text input projects for iOS, but none felt right and worked fully for our needs. We ended up spending a big portion of our time maintaining custom versions of other projects.
For that reason, we decided to build our own growing text input from scratch, and we've just released it as open source. We hope you all will find it useful!
Looks really great. Have you thought about submitting to CocoaControls? (https://www.cocoacontrols.com/) It's the second place that I look for iOS components (after a simple Google search, that is).
UITableView lays out cells from the top. If there aren't enough cells to fill the screen, there will be an empty area in the bottom part of the table view, between the last cell and the bottom of the table view (as you would expect).
Unfortunately, there isn't a standard way to invert a UITableView, and have cells laid out from the bottom.
So, the easiest solution for us was to set the table's transform to CGAffineTransformMake(1, 0, 0, -1, 0, 0) (flip the whole table upside down) and then give the cells the same transform (to cancel out the table view's transform).
A bit hacky, and causes indexPaths to be inverted as well (0,0 is now at the bottom), but worked for us.
I'm with you. I don't do iOS development at all, but I will literally sit there and go through the entire code of every iOS control submission to Hacker News just to see how they accomplish what they do. I cannot believe how much code it takes to do something I feel you can accomplish easily in javascript.
Kudos to all the iOS developers out there. I don't know how you guys manage to do it, but I'm sure glad you do and are willing to share your code with the rest of us.
So I'm making iOS apps sometimes, but have not implemented a chat feature.
Why would I want to use this rather than a UITableView where I append the newest message in the end of the UITableView every time (you'd have to increase it's length +1 for each new message, but hey that may be ok)?
This implements the input box, not the rest of it. Apparently, an automatically (vertically) expanding input box does not exist for iOS in the standard libraries for it.
Apple developed Swift to make developer's more expressive and efficient yet they do not provide simple controls like this. Can't tell you how many hours I wasted in the chat portion of my app trying to get a simple growing text input to work!
Try this out and let us know what you think. It's been designed in a way where you shouldn't care about the growing text input and trivial features related to it, but to build your tableView/collectionView cells and content.
If this works well, then it's enormously useful. I spent way too many hours trying to get the existing solutions to work, without success. (In the end, I had to implement the view in HTML and JavaScript!)
By subclassing SlackTextViewController, you'll get a tableView or collectionView, and a toolbar at the bottom containing the growing text input. That's basically it.
You may decide later to override some methods for disabling or enabling more features.
[+] [-] bradya|11 years ago|reply
For that reason, we decided to build our own growing text input from scratch, and we've just released it as open source. We hope you all will find it useful!
[+] [-] liyanchang|11 years ago|reply
[+] [-] obeattie|11 years ago|reply
Care to elaborate? Sounds intriguingly crufty.
[+] [-] bradya|11 years ago|reply
Unfortunately, there isn't a standard way to invert a UITableView, and have cells laid out from the bottom.
So, the easiest solution for us was to set the table's transform to CGAffineTransformMake(1, 0, 0, -1, 0, 0) (flip the whole table upside down) and then give the cells the same transform (to cancel out the table view's transform).
A bit hacky, and causes indexPaths to be inverted as well (0,0 is now at the bottom), but worked for us.
Seen a few other people take this approach as well: https://twitter.com/tapbot_paul/status/461161920402563072
[+] [-] kclay|11 years ago|reply
[+] [-] rip747|11 years ago|reply
Kudos to all the iOS developers out there. I don't know how you guys manage to do it, but I'm sure glad you do and are willing to share your code with the rest of us.
[+] [-] dirtyaura|11 years ago|reply
[+] [-] TeeWEE|11 years ago|reply
[+] [-] fdsary|11 years ago|reply
Why would I want to use this rather than a UITableView where I append the newest message in the end of the UITableView every time (you'd have to increase it's length +1 for each new message, but hey that may be ok)?
[+] [-] vertex-four|11 years ago|reply
[+] [-] mentos|11 years ago|reply
[+] [-] dzenbot|11 years ago|reply
[+] [-] harshaw|11 years ago|reply
I settled on https://github.com/oseparovic/MessageComposerView.
It's nice, simple, and does the trick. However, I will definitely checkout SlackTExtViewController.
For people not in IOS development: yes this is crazy that it is not built in. But our tool chain is better :)
[+] [-] thrush|11 years ago|reply
[+] [-] dzenbot|11 years ago|reply
[+] [-] ljosa|11 years ago|reply
[+] [-] cstigler|11 years ago|reply
[+] [-] dzenbot|11 years ago|reply