This repository was archived by the owner on Sep 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,20 @@ ContextMenuDelegate {
159159 . newIssue ( issueController: newIssueViewController)
160160 }
161161
162+ func workingCopyAction( ) -> UIAlertAction ? {
163+ guard let remote = self . repoUrl. absoluteString. addingPercentEncoding ( withAllowedCharacters: CharacterSet . alphanumerics) else { return nil }
164+
165+ guard let url = URL ( string: " working-copy://show?remote= \( remote) " ) else { return nil }
166+ guard UIApplication . shared. canOpenURL ( url) else { return nil }
167+
168+ let title = NSLocalizedString ( " Working Copy " , comment: " " )
169+ let action = UIAlertAction ( title: title, style: . default,
170+ handler: { _ in
171+ UIApplication . shared. open ( url)
172+ } )
173+ return action
174+ }
175+
162176 @objc func onMore( sender: UIButton ) {
163177 let alertTitle = " \( repo. owner) / \( repo. name) : \( branch) "
164178 let alert = UIAlertController . configured ( title: alertTitle, preferredStyle: . actionSheet)
@@ -173,6 +187,7 @@ ContextMenuDelegate {
173187 $0. popoverPresentationController? . setSourceView ( sender)
174188 } ,
175189 switchBranchAction,
190+ workingCopyAction ( ) ,
176191 AlertAction . cancel ( )
177192 ] )
178193 alert. popoverPresentationController? . setSourceView ( sender)
Original file line number Diff line number Diff line change 5252 <key >LSApplicationQueriesSchemes </key >
5353 <array >
5454 <string >org-appextension-feature-password-management </string >
55+ <string >working-copy </string >
5556 </array >
5657 <key >LSRequiresIPhoneOS </key >
5758 <true />
You can’t perform that action at this time.
0 commit comments