In a subclass of SBUChannelViewController,
If I register my own custom user cell or file cell (and they are subclasses of SBUBaseMessageCell)
then setTapGestureHandler and setLongTabGestureHandler do not get triggered for them. Is this a bug or is it expected behavior?
setTapGestureHandler and setLongTabGestureHandler are not going to triggered because its setter where you can set gesture. That being said, you have to create your own recognizer in that method and register if you want to subclass baseMessageCell.
On the other hand, you can subclass from UserMessageCell or FileMessageCell and take advantage on below methods
open func onLongPressContentView(sender: UILongPressGestureRecognizer) {}
open func onTapContentView(sender: UITapGestureRecognizer) {}
open func onTapProfileImageView(sender: UITapGestureRecognizer) {}
and override whichever you want like below
override func onTapContentView(sender: UITapGestureRecognizer) {
super.onTapContentView(sender: sender)
// your logic when tap on content
}
Actually I see a lot of public but not open classes and functions from the UIKit SDK that are I can not inherit/override in my code because of this (e.g. some functions in SBUChannelViewController).
Not sure if this is expected behavior or if it is a bug.
Only SBUBaseMessageCell can be inherited in the current version.
We’re opening the code considering the conflict with internal logic.
Update versions that have SBUUserMessageCell and SBUFileMessageCell modified to open class will be released within 1-2 weeks.
Sorry for the inconvenience in implementing it.
Please check the update after next week.