slackhq / SlackTextViewController

⛔️**DEPRECATED** ⛔️ A drop-in UIViewController subclass with a growing text input view and other useful messaging features
https://slack.com/
MIT License
8.32k stars 1.08k forks source link

InsertItem in invertedMode #180

Closed avently closed 9 years ago

avently commented 9 years ago

Hello. I tried to use SlackTextViewContoller in inverted mode with scrollView. Everything is good but inserting items doesn't work as excepted. What i did:

self.inverted = YES;

Then in cellForItemAtIndexPath

cell.transform = self.collectionView.transform;

Then i load data and items looks good in inverted mode. Then i'm making insert:

[self.collectionView insertItemsAtIndexPaths:@[indexPath]];

And see the cell is inverted twice. Left side changed to right side and up side changed to bottom side.

What should i do?

dzenbot commented 9 years ago

The support with collection view is still incomplete. I've been experimenting with a custom collection view layout, to be able to display cells from the bottom, and avoid using the hacky inverted mode. https://github.com/slackhq/SlackTextViewController/tree/swift-example

But that example is still incomplete too, and the layout needs more work.

You could still call reloadData directly, and avoiding that issue, but you'd loose the animation tho.

avently commented 9 years ago

Ok, I understood. I should change my implementation to tableView:) Is there any difference in speed or something with table or collection?

dzenbot commented 9 years ago

Not really. The advantage of using collectionView is about the freedom regarding layouts, but in terms of performance, I would bet UITableView is better. Good luck!