Provide default implementations for optional TextViewAttachmentDelegate functions
Expected behavior
Some functions of the TextViewAttachmentDelegate protocol should be considered optional since the functionality they provide is not required for many instances of a TextView. Specifically, the selection and deselection functions are not necessary if the text view is not providing any custom behavior for these actions (for example, relying on the delete key to remove the attachment, and not providing any additional attachment features).
These should be made optional by providing an empty default implementation in an extension to TextViewAttachmentDelegate:
extension TextViewAttachmentDelegate {
func textView(_ textView: TextView, selected attachment: NSTextAttachment, atPosition position: CGPoint) { }
func textView(_ textView: TextView, deselected attachment: NSTextAttachment, atPosition position: CGPoint) { }
}
Actual behavior
The selection and deselection functions are unnecessarily required by any object conforming to TextViewAttachmentDelegate.
Steps to reproduce the behavior
Conform to TextViewAttachmentDelegate and attempt to compile without implementing the two mentioned functions.
I would like to make this small change myself and provide a pull request - is there any information available on the preferred process for this? Thanks.
Sounds like a reasonable change. Our attachment delegates are a bit unclean right now so any help in that direction is welcome.
This is the closest we have to a guideline for submitting PRs to the project: https://github.com/wordpress-mobile/WordPress-iOS/wiki/Pull-Requests-guide-line
It's in a different repo, but we use the same guidelines.
Additionally, we're reachable in the WP.org slack server (channel #mobile) for any doubts, and you can always open an issue here in GitHub for additional questions related to work in Aztec.
Thanks @diegoreymendez. Very impressed with this project so far and hopefully I can make some more meaningful contributions eventually.
P.S. Can I get an invite to the slack?
@benpackard - It is my understanding that if you follow the link I sent earlier (this one), the invite should be sent automatically to you.
Can you double check the spam folder and let me know?