Hey everyone,
I've released MessageKit v0.1.0. You can download it via CocoaPods or master.
I think this goes without saying that this is a prerelease and not production ready. There is a lot of activity surrounding this project and I'm just trying to put something out there for everyone to work with.
"If you are not embarrassed by the first version of your product, you鈥檝e launched too late."
-Reid Hoffman
This project is in its earliest stages so the codebase is changing rather quickly. If you'd like to work on something please discuss it with me first so we can prevent merge conflicts.
Currently, we have no documentation for this project. The goal is to auto-generate some with Jazzy and also provide more personalized documentation via markdown files.
However, writing documentation at this stage of the project, considering the unstable API, provides little to no value.
Therefore, if you're looking to get involved, please take a look at the Example Project.
I've also added a Code of Conduct. This CoC is taken seriously by the project owners.
What about the idea of populating the conversation from the top?
@Codeido I'm not sure what you mean. Could you please elaborate?
Imagine that you have this list of messages. The character combination "<-" indicates the vertical offset where the user is positioned.
A
A
A <-
A
and you want to paginate old messages. Then you have to insert 3 messages on top of the list.
B
B
B
A
A
A <-
A
How to make this? And how to maintain the offset to the third cell A? Consider that the cells have dynamic height and the reuse of the cell involve the calculation of the offset.
Hasn't anyone started working on fixing layout changes after screen rotation yet? I'd like to help with something and this seems to me like a good place to begin.
UPD: @pinchih just created a bug for this problem.
@artemsmikh It's definitely a priority. I didn't have as much time as I thought to work on this, this weekend. If you want to take a shot at it I'd review a PR.
Closing in favor of #28. @Codeido I'm still looking into your suggestion 馃憤
Hey @darrarski, you've basically done @Codeido's suggestion before here?
@SD10 Yes, I tried to implement pagination, which you can check in my repo. It's not perfect, but I think it works quite well with reversed collection layout I've implemented.
What do you mean "it's not perfect?"? Where can be improved?
@darrarski Thanks!
@Codeido I opened an issue for this but seem to be missing the benefit of doing it?
What value does it bring?
Is like Whatsapp, Telegram, Instagram and every chat that I know. You can't download the entire chat (imagine if you have 100+ messages to download) one shot, you need to paginate it.
@Codeido there are several known issues, that are probably not that hard to fix. My code is not a one-size-fits-all solution. I developed it more as a R&D and not as a fully reusable solution. It should be a good point to start. Some of the issues are:
There are probably more issues like this and I think good approach would be to add some tests at this point that defines correct UI behavior.
When it comes to pagination, this is what I've done so far:
I encourage you to play with my implementation (you can find it here). For me one of the goals was not to use hacks and base on native components as much as possible. In case of any questions or problems, let me know and I till try to help solving them.
@darrarski I played with your implementation and it was very easy to read/understand.
Great work btw 馃憤 I guess I'm misunderstanding the benefit of reversing the collection view layout.
@Codeido I understand that, but I wasn't planning on adding any features for fetching messages to this project. I think it should be the users responsibility to control the number of messages they download and how they paginate 馃
@SD10 Thanks! I agree that fetching messages should not be part of the the MessageKit implementation. However, it should somehow provide API that allows pagination.
@SD10 I agree with the idea that the pagination is a responsibility of the user, but the reverse CollectionView and the idea of adding old messages are part of the implementation of the library because it changes the layout approach and when a message is added on top of the list, it changes the offset where the user is currently positioned. I don't know if I explained correctly the message that I want to communicate. Adding old messages in a collectionview is not a problem - actually - but the unwanted behavior is that the cell that the user actually sees is moved bottom.
Most helpful comment
Imagine that you have this list of messages. The character combination "<-" indicates the vertical offset where the user is positioned.
A
A
A <-
A
and you want to paginate old messages. Then you have to insert 3 messages on top of the list.
B
B
B
A
A
A <-
A
How to make this? And how to maintain the offset to the third cell A? Consider that the cells have dynamic height and the reuse of the cell involve the calculation of the offset.