fix: profile bio allow custom emoji user interact issue

This commit is contained in:
CMK 2021-07-26 15:17:59 +08:00
parent 9a9c2bad56
commit 71e2f46ede
1 changed files with 14 additions and 0 deletions

View File

@ -440,6 +440,7 @@ extension ProfileHeaderView {
bringSubviewToFront(bannerContainerView)
bringSubviewToFront(nameContainerStackView)
bioMetaText.textView.delegate = self
bioMetaText.textView.linkDelegate = self
let avatarImageViewSingleTapGestureRecognizer = UITapGestureRecognizer.singleTapGestureRecognizer
@ -522,6 +523,19 @@ extension ProfileHeaderView {
}
}
// MARK: - UITextViewDelegate
extension ProfileHeaderView: UITextViewDelegate {
func textView(_ textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
switch textView {
case bioMetaText.textView:
return false
default:
assertionFailure()
return true
}
}
}
// MARK: - MetaTextViewDelegate
extension ProfileHeaderView: MetaTextViewDelegate {
func metaTextView(_ metaTextView: MetaTextView, didSelectMeta meta: Meta) {