During demos in the WWDC videos, the presenter will often paste code into Xcode to save having to type it in. How are they pasting each different snippet without switching to another app to copy it?
Apple used custom code called "Demo Monkey" whose source code is available on GitHub.
You can create custom Xcode snippets. Snippets can include from one method to whole program.
Check this article on NSHipster, for me is one of the best explanations of this that I found.
They could be using an app that binds keyboard shortcuts to multiple clipboards, such as CopyClip.