-
Notifications
You must be signed in to change notification settings - Fork 596
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
Subclassing BaseMessageCollectionViewCell #46
Comments
Inheriting from BaseMessageCollectionViewCell is missing public access level for init(frame:) and createBubbleView() so they can't be inherited outside ChattoAdditions module as I mentioned in #26. Can you try that locally and make a PR if it works? |
Do you mean changing those methods to |
Yes, I mean changing those methods to public and verifying it solves your problem (that you can subclass the cells). ChatViewController has no problems being subclassed (it's done in ChattoApp) |
Just finished the work after struggling with Xcode for hours :/ With the changes in #48 I can successfully subclass BaseMessageCollectionViewCell. |
@bcamur thank you! |
You are welcome, and thank you; this was my first PR and contribution to an OSS project :) You can close the issue whenever you wish. |
Hi, I'm trying to subclass BaseMessageCollectionViewCell as you did with TextMessageCollectionViewCell and PhotoMessageCollectionViewCell, however even if I try to copy all of the code of TextMessageCollectionViewCell and rename it to something else I get several compiler errors such as: "Initializer does not override any method from its superclass".
Actually all I need to override is
canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool
function and add some methods for custom edit menu actions. I tried to do this in an extension of TextMessageCollectionViewCell but apparently Swift doesn't let me override canPerformAction in an extension. Do you have any suggestions or workarounds for this problem. Or any other way to add custom items to edit menu of chat bubbles. Thanks.The text was updated successfully, but these errors were encountered: