Want to keep the TNW Conference vibe going?? Tickets for TNW2022 are available now >>

The heart of tech

This article was published on February 8, 2016

    Xcode 7.3 beta build adds awesome new Interactive Playgrounds feature for Swift apps

    Xcode 7.3 beta build adds awesome new Interactive Playgrounds feature for Swift apps
    Nate Swanner
    Story by

    Nate Swanner

    Former Reporter, TNW

    TNW's former West Coast writer in the PNW (Portland, Oregon). Nate loves amplifying developers, and codes in Swift when he's not writing. If TNW's former West Coast writer in the PNW (Portland, Oregon). Nate loves amplifying developers, and codes in Swift when he's not writing. If you need to get in touch, Twitter is your best bet.

    Xcode 7.3 beta 2 is out, and adds one feature developers using Swift will really enjoy: Interactive Playgrounds.

    While Playgrounds have been a favorite for testing code for some time, it was a fairly static I/O protocol for making sure the code was correct. Now, you can test to see if the code you put in will actually perform while in use.

    Apple also has a nifty example of how Interactive Playground will work. So long as you have the Xcode 7.3 beta 2 installed, the NewtonsCradle.playground file is a good example of how you can actually test code in Playgrounds.

    It’s not as easy as writing code and crossing your fingers, though. Apple notes you’ll have to assign a liveView property to the XCPlaygroundPage where your code is, but that’s about it. You can even tweak your code and see results in real-time, and it will work for both iOS and OS X apps.

    An extremely cool addition to Xcode, Interactive Playgrounds could also accelerate the app building process. If you test in Playgrounds, there’s less chance of technical debt (someone please slap me for saying that) in your codebase.

    Interactive Playgrounds [Apple]