Search code examples
iosswiftxcode6swift-playground

Develop chart control using an xcode playground for iOS


I would like to experiment with building a simple but unique chart control for my iOS app with the new playground feature of xcode for iOS. However, I am struggling to get started using playground to create a uiview and use core fraphics . I can see a few examples for Mac osx using nsview but failed to translate those. Any help appreciated.


Solution

  • The blog post here http://www.myuiviews.com/2014/07/25/hello-swift-playground-with-uikit-in-xcode6.html describes how to use UI elements in a swift playground.

    The main take away that allows you to see UI within a playground seems to be to open the assistant editor view like so:

    Open the Assistant Editor by going to View -> Assistant Editor -> Show Assistant Editor. You'll see a new view on the right with the Console Output.