-
Notifications
You must be signed in to change notification settings - Fork 130
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
Replace DelegateProxy with concrete forward implementation #58
base: master
Are you sure you want to change the base?
Conversation
|
||
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { | ||
let messages = sections[indexPath.section] | ||
let message = messages[indexPath.row] |
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.
Without this PR, you likely to get crash here because given indexPath is not "reversed", which does not match indexPath passed to cellForRow
.
.map { i -> [MessageModel] in | ||
(0..<i) | ||
.map { | ||
MessageModel(imageName: "marty1", message: "\($0) hello", time: "00:00") |
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.
@marty-suzuki
You can change MessageModel
contents after merge, but please keep
- displaying indexPath to screen
- and to have different number of rows for each section
so it better demonstrates how the things work under the hood.
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.
Thank you for fixing issues.
Almost fixes are good. But to remove DelegateProxy is unconsidered implementing scrollviewWillbeginDragging and so on to outside of ReverseExtension. (scrollviewWillbeginDragging is one of example.)
On the other hand, to not remove DelegateProxy causes calling ReverseExtension's delegate implementations and outside delegate implementations.
We need to think about other solutions.
@toshi0383 |
Thank you! I’ll do when I have free time, but feel free to take over this one because it will probably be later this year. |
88da462
to
9cf32ec
Compare
to demonstrate indexPaths passed via re.delegate is correctly "reversed".
@marty-suzuki Bottom section (section index 0) should have 2 rows but has 10. Let me know if you have any clue.🙏 |
fixes: Issues like #23 , #36
I faced this non-reversed index issue with
willDisplay
delegate.