diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift b/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift index a3e806166a..e460116d02 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Content/StatusAuthorView.swift @@ -128,7 +128,7 @@ extension StatusAuthorView { // avatar button avatarButton.addTarget(self, action: #selector(StatusAuthorView.authorAvatarButtonDidPressed(_:)), for: .touchUpInside) - authorNameLabel.isUserInteractionEnabled = false + authorNameLabel.isUserInteractionEnabled = true authorUsernameLabel.isUserInteractionEnabled = false // contentSensitiveeToggleButton @@ -136,6 +136,7 @@ extension StatusAuthorView { // dateLabel dateLabel.isUserInteractionEnabled = false + self.addTapGestureToAuthorName() } } @@ -215,6 +216,10 @@ extension StatusAuthorView { return (menu, accessibilityActions) } + private func addTapGestureToAuthorName() { + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(StatusAuthorView.authorNameDidPressed(_:))) + authorNameLabel.addGestureRecognizer(tapGesture) + } } extension StatusAuthorView { @@ -224,6 +229,12 @@ extension StatusAuthorView { statusView.delegate?.statusView(statusView, authorAvatarButtonDidPressed: avatarButton) } + @objc private func authorNameDidPressed(_ sender: UIButton) { + guard let statusView = statusView else { return } + + statusView.delegate?.statusView(statusView, authorAvatarButtonDidPressed: avatarButton) + } + @objc private func contentSensitiveeToggleButtonDidPressed(_ sender: UIButton) { guard let statusView = statusView else { return }