There are pieces of code that I type over and over again.

Sometimes it is a familiar SwiftUI view with the same modifiers. Sometimes it is the outline of a function, a testing helper, or a block of code with several values that need to be replaced. Copying that code from another project works, but only if I can remember which project contains the version I want.

Xcode code snippets gives you a better option. A snippet is a reusable code template that lives in Xcode's Library. It can be inserted from the Library or offered directly by code completion after you type a shortcut.

I covered the basic workflow in my video, Creating, Using and Sharing Xcode Snippets. This was the second video I ever created, so even though it was published in January 2020, it is still valid today.