Name: swift-sandbox
Owner: International Business Machines
Description: Tutorial for the Swift Package Catalog and Swift Sandbox
Created: 2017-03-14 05:35:19.0
Updated: 2018-04-30 20:38:56.0
Pushed: 2017-03-15 15:07:54.0
Size: 1598
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Learn how to utilize the IBM Swift Package Catalog and the IBM Swift Sandbox to accelerate your Swift development with ease.
This tutorial takes less than 5 minutes to complete!
Section 1: IBM Swift Package Catalog
In this section you will become familiar with the main features of the IBM Swift Package Catalog, and how they can augment your Swift development experience.
Searching for community Swift packages is one of the main value adds provided by the IBM Swift Package Catalog. Swift packages are mildly categorized, but we support fuzzy search on packages as well.
Please open Swift Package Catalog in a new tab.
In the search bar on the landing page, enter a package or category you are looking for:
Hint: If you aren't sure what you are looking for, try
json
.
Note: After filling in the search bar, hitting
Enter
or clickingSee All Results for "json"
will bring you to a comprehensive search page with more results.
Search for, navigate to, and view the READMEs for each of the following packages:
Being able to easily view the Swift packages that depend on a specific Swift package gives some valuable insight into the community view of that package. This is easy to view with the IBM Swift Package Catalog.
While viewing the READMEs from the previous Checkpoint, off to the right there is a panel of information about each of the packages:
By arrowing down on the Dependents
field for each, you can view the dependents.
Likewise, if you are interested in the Dependencies
of a given package.
View the dependents and dependencies for the following packages:
We try our best to populate our Swift package index on a regular basis as new packages are released, but we are only humans. If you know about Swift packages that you can't find while searching the IBM Swift Package Catalog then please help us out. Its easy, all you need is a public GitHub repo.
From any page in the catalog, click the Submit a Package
in the navigation bar.
Then simply submit the url associated with the package's GitHub repository.
Note: It can take a few moments before our backend processes your submission. If you don't see the package appear in the catalog within an hour, something likely didn't work. Check that the url you submitted is accurate, and the repository is public.
In this section we build on the Swift Package Catalog experience and discover the IBM Swift Sandbox environment where you can try out Swift server samples, or craft entirely new snippets of Swift code rapidly, in a safe environment.
Back in your Swift Package Catalog browser tab, either navigate to the IBM-Swift/SwiftyJSON package or just click here SwiftyJSON
You will notice that this particular package has a new button near the
View on GitHub
button that looks like this:
When a Swift package in the Swift Package Catalog has this button it means the
package owner has provided samples to try out the package code in the Swift
Sandbox. Go ahead and click Try in Sandbox
for IBM-Swift/SwiftyJSON and
select one of the registered samples that appear:
Once you are redirected to the IBM Swift Sandbox, run the sample as is by clicking the play button in the bottom middle of the screen:
The result is output in the right hand side panel.
Did the sample run successfully? It should have output:
In the interest of time, simply change the json name
value to be Bob
instead of Jack
:
Bonus: If you are feeling brave, ditch the sample and create your own snippet. It just has to run within 5 seconds, and no network activity.
Run the modified sample (now your custom snippet) to see the changed result. It should now output:
Now that you have made some custom snippet on the IBM Swift Sandbox, you should probably share it with the world. We make sharing your snippet, easy!
Click the Save Code
button on the bottom navigation bar:
Fill in the form:
After clicking Save
you will have the option to share via link or social media:
Send your code snippet link to a friend.