Ogre Codes

Follow @ogre_codes to get notified when new articles are posted to this site.

Setting Up Playgrounds

Jan 22, 2017 at 11:18 AM

One of the truly great things about Swift is their Playgrounds/ REPL, but it's a little bit confusing getting them set up to work with your project. Unfortunately, it's not entirely obvious how to integrate a playground into a project. I found [a great how-to](https://medium.com/@LogMaestro/adding-playgrounds-to-your-xcode-project-79d5ea0c7087#.ji5j9ggqc] on Medium. It seems like a lot bit of a quagmire to get one of the tentpole features of Swift set up to properly get going, but once you are online, it's phenomenal. My work testing flow tends to be try it on the REPL/ Playground -> then built tests out of the REPL.

I try to do Test Driven Development when I can, but often I break Bob's Three Rules. For me, sometimes it's easiest to express a concept in code than it is to express it as a test.

Update: 1/26 After a few days with the playground installed as part of the base system I wound up removing it. I'm not certain, but it seemed like they were causing major slowdowns in compile times and constantly spinning in the background. I love the concept and I think there is a way to set them up outside your main project so I'm going to try that down the road a bit when I get some time.