Sometimes I'm writing some code on a playground that takes a while to complete. For example:
var values = [[Int]](count: 10000, repeatedValue: [Int](count: 73, repeatedValue: 0))
And everytime the playground wants to refresh the results, it has to run that piece of code (that takes a while to run) and it makes Xcode as a whole very sluggish.
I still want to be writing my code on a playground since it has some very nice features for testing your algorithms. However, I'm finding that I have to comment certain lines of code just to continue writing without interruptions.
Is there any way to say to Xcode: "Do not run my playground right now. I'll tell you when it's ready."?
In Xcode 7, you can choose between automatic or manual execution of a playground by clicking and holding the ► arrow at the bottom left part of the playground.
Documentation link
I don't know an official way to do this but... If you leave a multiline comment at the bottom of the playground and do not add the closing */ tag it will not run until the closing tag is added.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With