This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Fix pushing Issues VC when user taps on username in referenced issues #2766
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #2260. 🤞
When user taps
IssueReferencedCell
, 2 competing delegates can be notified -UICollectionViewDelegate
MarkdownStyledTextViewDelegate
When both delegates are notified (for example when user taps username in a referenced issue),
UICollectionViewDelegate
(IssueReferencedSectionController
) will push a newIssuesViewController
:GitHawk/Classes/Issues/Referenced/IssueReferencedSectionController.swift
Line 39 in f28b119
and
MarkdownStyledTextViewDelegate
(IssuesViewController
) will present a profile viaSFSafariViewController
:GitHawk/Classes/Utility/UIViewController+Routing.swift
Line 21 in 80d1255
Since
IssueReferencedSectionController
implementsUICollectionViewDelegate
, I made it conform to the competing delegate (MarkdownStyledTextViewDelegate
) so that we can figure out which delegate should proceed - if we're notified that username was tapped, we'll present the profile VC and set a flag that will prevent the other delegate from pushing the Issues VC.Let me know if there's a better way to do this. 🤔