Xcode 7.3 Beta 2 introduces live interactive playgrounds

Interactive playgrounds return in Xcode 7.3 Beta 2. These were a thing that got put aside when Apple integrated the iOS simulator into the playground assistant, and have finally re-emerged. Here’s an example in action. The following demonstration creates a view controller instance and ties a switch to a custom action callback.

Unfortunately, a lot of the tricks I used to do to create full-class OS X apps that supported drag and drop into playground windows are no longer working under the current system. I could, however, create a basic interactive NSView that properly handled mouse events:

I’m a little sad about the wider drag-and-drop utility for system interaction being lost. I’m hoping this returns in a later beta.

6 Comments

  • Inspired by you to update AudioKit’s playgrounds:

    ref=tw-share

  • unfortunately CenterViewInSuperview is missing in your first example -> Use of unresolved identifier “CenterViewInSuperview”

    • The centering isn’t really what makes this special, just remove those lines and do formatting your own way.

  • What is the library for AutoLayout used in this file? I don’t think it’s Masonry, not sure if PureLayout. I’m just curious what’s your first choice of library for AL 🙂

    • I have gadzillions of Auto Layout libraries, all custom. This one is just a tiny one I use for playgrounds: https://gist.github.com/erica/a0f4ee23e9ee5dc1b489

      My rule of thumb for Auto Layout is this: write your own libraries. It only takes a few hours and you learn more than you would otherwise trying to invest time in someone else’s dependencies. (I have a book, it’s slightly out of date but still applicable to 95% of what you need. Maybe 98%)

      • I knew that by asking this question I will gain some interesting insight! Thank you!