Skip to content

Creating a Swift Playground in XCode and adding it to a Git Repo on BitBucket

June 24, 2014

In a previous post Creating a Swift Project in Xcode 6 and adding it to a git repo on BitBucket, I created a sample OXS command line project. I now want to create a collection of sample playgrounds to test out all of the language features of swift. Setting this up is essentially following the same set of steps but instead of section “Create a sample swift project (OSX command line tool)” do this instead:

Create a playground

  • Open XCode
  • File > New > File…
  • Choose template iOS > Source > Playground
  • Click Next
  • Save As: Sample.playground
  • Choose a suitable location e.g. ~/dev/repos/swift/samples
  • Click Create
  • A playground file will now open
  • Close the playground and follow the next section

Create a Git repo for the playground folder

Open a terminal window at e.g. ~/dev/repos/swift/samples


git init
git add *.playground
git commit -m "adding playgrounds"

Now follow the instructions in the previous post from section “Create a Git Repo on BitBucket”

Links

Apples Swift page

Exploring and Evaluating Swift Code in a Playground

 

Advertisements

From → Apple, Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: