Mac Catalyst Copying NSURLs to the pasteboard translation is bad?

So I copy a link to the pasteboard in Mac Catalyst. I can do this directly or by using system provided "Copy" in WKWebView from the WebUIDelegate method -webView:contextMenuForElement:willCommitWithAnimator: (which creates a "Copy Link action in the system provided "suggested actions").

So when I copy a link on Mac Catalyst like this:

[UIPasteboard generalPasteboard].URLs = @[urlToCopy];

And I try to paste it in Xcode (assuming I'd be pasting the URL string in this context) Xcode plays NSBeep and nothing is pasted. I have to paste the link in TextEdit in a Plain Text Document, select the text, copy it again and then paste it back in Xcode.

I'm having a pretty bad day here. Almost nothing is working.

This works better it seems:

NSString *string = urlToCopy.absoluteString;
NSArray *objects = (string != nil) ? @[urlToCopy,string] : @[urlToCopy];
[[UIPasteboard generalPasteboard] setObjects:objects];

Will have to remove WKWebViews default copy action.

FB12010301

Also noticed copying multiple links to the pasteboard does not work on Mac Catalyst.

[UIPasteboard generalPasteboard].URLs = @[appleDotComURL,websiteTwoURL,websiteThreeURL];

On iOS when I do that I can open "Notes" and paste and the strings for all three urls paste properly. But doing the same thing on Mac Catalyst it just pastes one url string...

Mac Catalyst Copying NSURLs to the pasteboard translation is bad?
 
 
Q