-
Notifications
You must be signed in to change notification settings - Fork 233
Added didSelectRowAtIndexPath callback #8
base: master
Are you sure you want to change the base?
Conversation
Hi Dennis Unfortunately I've got example app crashing while running the code and tapping on a message. It looks like now it is mandatory to have the didSelectRowAtIndexPath: function, which I believe should be optional (this is really not required to display the messages). In this case the code should also check if the selector exists (this is the cause of the crash). I understand you want to add it but let's put this on hold, cause now I have feeling that putting action function into data source is wrong. There are two ways out: 1. Refactor the data source to anything else (let's say UIBubbleTableDelegate?) or 2. Create yet another protocol UIBubbleTableViewDelegate which is pretty same as UIBubbleTableDelegate. Second point above makes no sense to me as long as it's just redefinition, and does not solve conflicts of UIBubbleTableViewDelegate and UITableViewDelegate as they both have same method: didSelectRowAtIndexPath So now I'm inclined to think of renaming UIBubbleTableViewDataSource to anything else and extending it. Thank you |
ok, thanks for the reply. I also tried setting tag for the views I add with [NSBubbleData dataWithView:attachmentImageView...] but it seems the tag is not preserved when the controller gets the callback?! Possible solutions would be to add a custom field to NSBubbleData which the controller can set and then read when the callback is called. Do you understand what I mean? What do you think would be a good solution? |
Hi Dennis. Alright, now I see what you mean. That's true, that inside of UIBubbleTableView data is sorted in it's own way and one can not know for sure what was pressed. Thank you for pointing this out. Ok, this needs to be fixed then. Returning index in the callback, however, I think does not make much sense as long as you don't know that's there with this index. There are two possible solutions in my head right now:
Any other ideas? |
Ive currently implemented solution 1 in my private branch, which I find easier to work with. Im also testing out other fixes so unfortunately my fork in not in state of pulling. |
How do I get a response from BubbleTypeSomeoneElse and flow it into the UIBubbleTable. I Poll an API that we built to see if there are any new messages for me, so How to I put the new messages that were sent to me, and display them in the UIBubble Table as Bubble TypeSomeoneElse |
Extended UIBubbleTableViewDataSource with a new callback for when bubbles are selected.
It seemed much nicer solution than having the current controller being a delegate for both UIBubbleTableViewDelegate and UITableViewDelegate (the table view got messes up when having both delegates).