Can't drag (to make code snippet) in Xcode

Jack Bellis picture Jack Bellis · Jun 1, 2011 · Viewed 8.8k times · Source

When I follow all the instructions (including apple's video) to drag text to create a code snippet in xcode, I get a different system behavior: all I see is the selection ibeam... I can't drag. It just ends up selecting text again. Am i missing some obvious Apple-ism? Thanks

Answer

brainray picture brainray · Jun 18, 2011

Yes, I ran into the same problem, and Apple-ism seems to be a good term for this issue :)

It works this way:

  • Select (or highlight) the code your want to turn into a snippet
  • EDIT: Click and hold (do not drag!) on any part of the selected text for a short moment (like 2 seconds, sometimes 8 seconds)
  • EDIT: The mouse cursor will change icon (not on El Capitan).
  • Now you can drag the code over the snippets library, where a green + icon will appear. EDIT: On El Capitan the green icon does not appear, but the frame of the code snippets window will become thinner.