-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simpler way to customize header and footer views in the Message List #3567
Add simpler way to customize header and footer views in the Message List #3567
Conversation
…s and next messages in the Channel
SDK Size
|
SDK Performance
|
SDK Size
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I think we should just keep the loading indicator in the sample app. Also, we need to add docs in the other repo.
// Example of custom header views. | ||
// The same code should be provided to `ChatThreadVC` if you want the same behaviour in threads. | ||
|
||
lazy var messageListHeaderView: UIView? = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe the loading indicator is enough for the showcase? I think we should keep the sample app as clean as possible, and this label is not very common for messaging apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can explain in the docs the channelController.hasLoadedAllPreviousMessages
, customers here would usually show some custom UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was planning on adding docs. So yeah maybe the "Loaded all messages" we can do it only for the docs 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see the spinner while loading more messages. ✅
…s-to-message-list
Quality Gate passedIssues Measures |
🔗 Issue Links
Resolves https://linear.app/stream/issue/IOS-450/
Resolves https://linear.app/stream/issue/IOS-560/
🎯 Goal
📝 Summary
ChatMessageListVC.headerView
+ChatMessageListVC.footerView
ChatChannelVC.loadPreviousMessages()
+ChatChannelVC.didFinishLoadingPreviousMessages(error:)
ChatChannelVC.loadNextMessages()
+ChatChannelVC.didFinishLoadingNextMessages(error:)
ChatThreadVC.loadPreviousReplies()
+ChatThreadVC.didFinishLoadingPreviousReplies(error:)
ChatThreadVC.loadNextReplies()
+ChatThreadVC.didFinishLoadingNextReplies(error:)
🛠 Implementation
Header + Footer
The
ChatMessageListVC.headerView
andChatMessageListVC.footerView
internally account for the fact that the table view is inverted, so the views are automatically mirrored and set the header as footer and vice-versa.Customizing loading views
Since the header and footer views are commonly used to render loading views, it made sense to merge 2 tickets into this PR.
This PR makes it easier to handle state management when loading more messages/replies in either the Channel or the Thread.
🧪 Manual Testing Notes
A simple loading view indicator was added when loading more messages in the Demo App:
☑️ Contributor Checklist
docs-content
repo