📃 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.
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.
nef playground will be created for iOS platform. If you need to change it, you can use the
➜ 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>
<Xcode Playground> is the path to your Xcode Playground.
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.
--bow-version <x.y.z>: Specify the version of Bow that you want to use in the project. This option lets you test an old version of the library in an Xcode Playground. Example:
➜ nef playground --name OldBowProject --bow-version 0.8.0
--bow-branch <branch name>: Specify the branch of Bow that you want to use in the project. This option lets you test features of Bow that are still in development in a branch that has not been merged or released yet. Example:
➜ nef playground --name BranchBowProject --bow-branch master
--bow-commit <commit hash>: Specify the commit hash of Bow that you want to use in the project. This option lets you test features of Bow exactly at the moment you need, released or not. Example:
➜ nef playground --name CommitBowProject --bow-commit e70c739067be1f5700f8b692523e1bb8931c7236
--podfile <podfile>: Specify a Podfile with your own dependencies. This option lets you create a Playground with support for other libraries. Create a
Podfilelisting your dependencies and pass it to
Podfile, located in
target 'MyPodsProject' do platform :osx, '10.15' use_frameworks! pod 'Bow', '~> 0.8.0' end
➜ nef playground --name MyPodsProject --podfile ./folder/dependencies/Podfile
--cartfile <cartfile>: Specify a Cartfile with your dependencies. Create a
Cartfilelisting your dependencies and pass it to
Cartfile, located in
➜ nef playground --name MyCarthageProject --cartfile ./folder/dependencies/Cartfile