📃 Creating a nef Playground

Xcode Playgrounds are a nice tool for prototyping and trying new concepts. However, third party libraries support is a bit cumbersome to add. One of the goals of nef is to make the creation of an Xcode Playground easier with support for one or more libraries.

By default, nef can create an Xcode Playground with support for Bow, the Functional Programming companion library for Swift.

 ➜ nef playground

And you can use the following option to specify the name for the nef Playground that you are creating:

 ➜ nef playground --output ~/Desktop --name LatestBowProject

It will create an Xcode project with support for the latest available version of Bow, named LatestBowProject in your ~/Desktop. If you open this nef playground, you will find an Xcode Playground where you can import Bow or any of its modules, and start trying some of its features.

By default, nef playground will be created for iOS platform. If you need to change it, you can use the --platform option.

 ➜ nef playground --platform osx

🚨 If you need to take advantage of nef in your Xcode Playgrounds, you can transform your Xcode Playground into a nef Playground using the following command:

 ➜ nef playground --playground <Xcode Playground>

Where <Xcode Playground> is the path to your Xcode Playground.

Options

You can create a nef Playground compatible with any different Bow version, branch or commit; even third-party dependencies

Note: The next options are mutually exclusive.

 

 ➜ nef playground --name OldBowProject --bow-version 0.8.0

 

 ➜ nef playground --name BranchBowProject --bow-branch master

 

 ➜ nef playground --name CommitBowProject --bow-commit e70c739067be1f5700f8b692523e1bb8931c7236

 

Your Podfile, located in ./folder/dependencies:

 target 'MyPodsProject' do
   platform :osx, '10.15'
   use_frameworks!

   pod 'Bow', '~> 0.8.0'
 end
 ➜ nef playground --name MyPodsProject --podfile ./folder/dependencies/Podfile

 

Your Cartfile, located in ./folder/dependencies:

 github "bow-swift/Bow"
 ➜ nef playground --name MyCarthageProject --cartfile ./folder/dependencies/Cartfile