As we have seen throughout this chapter, and this book, playgrounds are a great canvas for exploring APIs, frameworks, and custom code. However, if you want to explore uses for your own code, it appears that you need to include all the code in the playground and that can make it long and unwieldy.
It doesn't need to be that way. In this recipe, we will see how you can embed Swift code in your playground and make use of it from your playground code.