When I open up the Library window in Xcode 14. and click on a particular control like the Picker, I see code samples for using the particular control.
I can highlight the sample code text and right click it and choose [Copy] from the context menu (see image).
However, when I do that:
Sample Code Doesn't Paste In
Then when I go to Xcode to paste the text in, the sample code does not appear. Instead, I either get nothing pasted in or the last thing I copied is pasted in.
And, yes, copy / paste works everywhere else on my mac with no problems.
How can I copy that code sample?
The only way I could ever copy that sample code was to :
Choose Share -> Notes (see image)
Then open notes and copy it from there and it successfully pasted into Xcode.
Update: Additional Way To Get Code Sample
I was back in Xcode and I happened to scroll all the way to the bottom of the Picker documentation entry and I found a link that will open the document in Developer Documentation (see red highlight in image).
If you click that link then Apple Developer Documentation window opens and you can copy the sample code.