A curated list of awesome Swift playgrounds.
Downloading all the playgrounds
Unless otherwise indicated, all playgrounds are compatible with Swift 3.
All the playgrounds are available as submodules in the
playgrounds/ directory, to download them all in one go, just clone this repository with
git clone --recursive https://github.com/uraimo/Awesome-Swift-Playgrounds.git or execute
git submodule update --init after you have cloned the repository the usual way.
Apple’s playgrounds distributed as zip archives have to be downloaded manually.
🌟 = My personal favorites
🍁 = Swift 4+ Playground
⏳ = Pre-Swift 3 Playground
- Learning Swift
- Learning Swift: Advanced Topics
- Apple’s Playgrounds
- WWDC Students Submissions
- Playgrounds about Playgrounds
- Playgrounds from Playgroundbooks
- Theoretical Computer Science
- UIKit And Graphics
- Libraries and APIs
- Playground sets
Playgrounds that can be run on your iPad
- Guilloche Pattern Playground Book – Learn more about this pattern you see every day, but probably never knew it was really carefully designed. 🍁
- Accessibility – Accessibility for iOS developers. 🍁
- TJBot Playground – Swift Playground for interacting with IBM’s TJBot. 🍁
- Tree Trouble Playbook – An interactive Swift Playground Book about Binary Search Trees.
- Auto Pong – A tutorial to implement a pong based on a simple AI.
- Neural Network Playground – A neural network Swift playground, with no third party dependencies.
- Window Manager Playground – Playground for an experimental window manager.
- AudioKit Playground Book – A set of playgrounds using AudioKit designed for the iPad Playgrounds app.
- Numsw – A swift playground book that mimics some of the features of numpy and jupyter notebook.
- File Browser Playground – Simple File Browser for Swift Playgrounds on iOS.
- Geometry with Swift – In this course your students will learn the fundamentals of Swift 3 programming, using geometry as their context for learning.
- Image Filtering – A Swift playgroundbook about Image Filtering. 🍁🌟
- Spacetime Rhapsody – A Swift Playground visualizing gravity based on Einstein’s Theory of General Relativity. 🌟
- Neural Network – A Swift PlaygroundBook about Neural Networks. 🍁
- coreml-playground – Core ML examples for Swift Playgrounds. 🍁
- SF Symbols Viewer – An SF Symbols Viewer for Swift Playgrounds. 🍁
Some interesting playgrounds to learn Swift
- What’s new in Swift 4 – An Xcode playground showing off the new features in Swift 4.0. 🍁 🌟
- What’s new in Swift 4.2 – An Xcode playground showing off the new features in Swift 4.2. 🍁 🌟
- Codable Playground – Playground that demonstrates advanced uses of Codable. 🍁
- Generics In Swift – Playground that explains generics. 🍁
- Swift String Cheat Sheet – A quick guide to using Strings with Swift. 🍁
- About Swift – A playground about Swift language. 🍁
- The Swift Programming Language Playgrounds – 40+ playgrounds, one for each chapter of Apple’s Swift book. 🌟
- Swift Hack Pack – Collection of playgrounds that teaches Swift.
- The Swift Summary Book – A summary of Apple’s Swift language. 🌟
- Swifter Tips – Examples for every feature of the Swift language.
- MPCS51032 UChicago iOS Course – Playgrounds from the 2017 Spring iOS course of the University of Chicago.
Learning Swift: Advanced Topics
Advanced topics, useful once you have mastered the basics of the language
- A Swift Introduction to Core Data – Learn Core Data experimenting directly in this playground. 🌟
- TDDSwiftPlayground – Demonstration of using Swift Playgrounds in Test Driven Development with XCTest.
- Concurrency on iOS – Concurrency and Parallelism in iOS.
- Modern Core Data – An introduction to Core Data.
- Swift DSL Example – Implementation of a DSL in Swift.
- Katan – A micro web server that replies “Hello world!” to every request, an example of how to use sockets in Swift.
- Swift Regular Expressions – A playground to learn regular expressions with Swift.
- Network Stack – Clean & simple Swift networking stack playground.
- Swiftly Typed Resources – A playground showing how Swift makes Strings, Colors, Fonts, Images, etc easier to deal with. ⏳
- Swift KVO Closures – Swift KVO playground. ⏳
- Swift Date Tutorial – Learn everythig about NSDate. ⏳
- Swift And C – Examples about using C with Swift. ⏳
- Swift Memory Management – How to avoid retain cycles, from this post. ⏳
- The Principles of OOD in Swift 4 – The Principles of OOD based on Uncle Bob articles.🍁
- Design Patterns Playground – Learning GoF’s Design Patterns in Swift 3.
- iOS Design Patterns – Sample projects for MVC, MVP, MVVM, and VIPER.
- Design Patterns in Swift – Design patterns in Swift 3.
- GOF Swift – Learn all 23 Gang of Four patterns using Swift.
Protocol Oriented Programming
- Swift Diagram Playgrounds – Adaptation of the Protocol-Oriented Programming in Swift talk from WWDC 2015.
- Swift Protocol Extensions – A playground to explore Protocol Extensions. ⏳
- Battleship Example – An example of how to use Protocol Oriented Programming with the battleship game. ⏳
Functional Reactive Programming
- ReactiveCocoa Playground – The easiest way to get a taste of ReactiveCocoa. ⏳
- Swift Reactive Playground – Companion to the article: ReactiveCocoa made Simple With Swift. ⏳
Playgrounds from Apple, usually presented at some WWDC
- Apple’s Mandelbrot Playground – A playground with the mandelbrot fractal (updated to Swift 3 by @palmerc, @kemalenver).
- Interactive Newton’s Cradle – Apple’s interactive playground of a Newton’s Cradle where collisions and gravity are applyed with UIKit dynamics. 🌟 (updated to Swift 3 by @p-sun)
- Apple’s Balloons Playground – The balloons playground showed at WWDC14. ⏳
- Apple’s Crustacean Playground – Protocol-Oriented Programming with Value Types. ⏳
- Apple’s Swift Standard Library Playground – experiment with Swift standard library types and high-level concepts using visualizations and practical examples. ⏳
WWDC Students Submissions
Playgrounds submitted by students for the WWDC scholarship
Playgrounds about Playgrounds
Playgrounds that describe what you can do with playgrounds
- XCTest Playground – Better looking tests for playgrounds.
- Interactive Playground – Exploring interactivity in Playgrounds.
- Mondrian – Make iOS app mockups in Swift 2.x playgrounds. ⏳
Playgrounds from Playgroundbooks
Playgrounds derived from iPad Swift Playgroundbooks
- iPad Swift Playgrounds – The sample playgroundbooks converted to playgrounds.
Theoretical Computer Science
- Functional Debug View – Playground to visualize functional programming with graphical sequences. 🍁 🌟
- OOP with Functions in Swift – Object-Oriented Programming in Functional Programming in Swift. 🍁
- Logician – Logic programming in Swift. 🌟
- Function Composition in Swift – Exploration of function composition in Swift. 🌟
- Swift Adventures in Monad Land – Learn about monads.
- Functional Design Patterns – A few functional programming concept and patterns.
- Learn about transducers – A little tutorial that explains transducers. ⏳
- Swift Functors, Applicatives, and Monads in Pictures – Companion to the article: Swift Functors, Applicatves, and Monads in Pictures. ⏳
- Functors in Swift – A playground to introduce Functors in Swift, and their practical usage. ⏳
Algorithms and Data Structures
Algorithms and data structures implemented in Swift
- Animated Sorting Algorithms – Swift 4 playgrounds to view and manipulate sorting algorithms.🍁
- Expressions – Arithmetic and logical expressions elegantly modeled and visualized using protocol-oriented binary trees.🍁
- Swift Algorithm Club – Algorithms and data structures in Swift with explanations. 🌟
- Sorting Experiments – Alluring experiments with sorting algorithms in Swift, sort of.
- Visual Binary Trees – Effortless visualization of arbitrary Binary Trees, along with their pluggable traversal implementations. 🌟
- Julia Fractal Playground – A Swift playground that generates beautiful Julia set fractal images.
- A Star – Protocol oriented A* pathfinding algorithm implementation in Swift 4.🍁
- Sorting Algorithms – Live Visualization of some famous sorting algorithms and your experiments.
- DataStructures Playground – Data Structures and Algorithms in Swift. ⏳
- Swiftography – Standard cryptographic algorithms in a Swift Playground. ⏳
- Algorithms Playground – Various algorithm implementation in Swift. ⏳
- The Jelly Bean Problem – The Jelly Bean problem from Wait But Why. ⏳
- Euclidean Strings – A playground leveraging ReSwift to generate Euclidean Strings. ⏳
Programming language interpreters implemented in Swift
- Introduction to Compilers – Great introduction to the inner workings of compilers. 🍁🌟
- Pascal Interpreter – Simple Swift interpreter for the Pascal language inspired by the Let’s Build A Simple Interpreter article series. 🍁
- Write your own language: Mu – A playground explaining how to create a tiny programming language named Mu. 🌟
- ASM Swift – A playground for learning Assembly language through Swift. 🌟
- Let’s build a compiler in Swift – Let’s Build a Compiler by Jack Crenshaw translated to Swift Playgrounds. 🌟
- Register VM – A register-based VM in a Swift playground. 🌟 ⏳
- Turtle Playground – A playground with Logo-like commands. 🌟 ⏳
- Swift Brainfuck – Brainfuck interpreter written in Swift using Playground. ⏳
- Emoji Intelligence – Neural Network built in Apple Playground using Swift. 🌟
UIKit And Graphics
A list of playgrounds that demostrate various aspect of UIKit and other graphical frameworks
- UIStackView Playground – Interesting examples of use of UIStackViews.🌟
- Bezier Path Playgrounds – Some playgrounds to better understand UIBezierPaths.
- UIKit playground – Playgrounds to experiment interactively with UIKit views.
- UIDynamic Playground – Multiple Playgrounds using almost every behaviour of UIDynamic.
- WWDC16 Typography 🇯🇵 – Draw a logo or any text with the WWDC16 ASCII texture.
- Animated GIF Playground – Swift playground for generating animated GIFs.
- RPClarity – Shows a technique for blurring an image behind the characters behind one or more UILabels. ⏳
- Swift Clock – An animated clock in a swift playground. ⏳
- WatchKit Asset Playground – A swift playground for creating awesome animations for your WatchKit Apps. ⏳
- Swift 2.0 Protocol Extension Example – Showing how to use Swift2 protocol extensions to render errors in UIViews and UIViewControllers without subclassing or creating classes. ⏳
- Tinting – A small playground to demonstrate image tinting in UIKit. ⏳
- Ray tracing Playground – A playground and a series of articles on ray tracing, see also part 2, 3, 4, 5 🌟 ⏳
- WWDC16 Logo Playground – Drawing the WWDC16 logo in a playground. ⏳
- Interpolation Playground – Playground demonstrating lerp, smooth step, Catcall-Rom and others! ⏳
- CoreImage for Swift Playgrounds – Growing collection of CoreImage playgrounds from the upcoming book “CoreImage For Swift”. 🌟 ⏳
- Image Processor – Implementing different image filter algorithms. ⏳
- Metalbrot – Interactive playground that draws the Mandelbrot fractal with Metal. 🌟
- METAL Playground – Apple Metal framework playground. 🌟 ⏳
- Core Animation Swift Playgrounds – A set of interesting Core Animation playgounds.
- UIViewPropertyAnimator Playground – Playground demonstrating UIViewPropertyAnimator.
- WWDC Crowd Simulator 2017 – A SpriteKit experiment to simulate the WWDC2017 logo crowd.
- Duet-Inspired Trail Effect – How to get a Duet style trailing effect in SpriteKit.
- Additive Animations – Experiment with multiple additive animations in Core Animation. ⏳
- Core Animation Playground – Companion to Apple’s Core Animation Programming Guide. ⏳
- Core Animation Timing – Playground demonstrating effects of CAMediaTiming properties. 🍁
- SceneKit ARKit Demo – The Xcode 9 ARKit SpriteKit demo as a playground.🍁
- SpriteKit Swift 3 – Playground for exploring Sprite Kit.
- SpriteKit Collisions – Demonstrates how to perform physics collision detection using Swift and SpriteKit. ⏳
- SceneKit Examples – Experiment with SceneKit and Swift. ⏳
- Astronomy – A 3D earth model written in swift playground using SceneKit.
Sounds and music
- Bach Playground – A Simple Swift Playground that plays a brief piece by Bach with AVAudioEngine and AVMIDIPlayer.
- PlayerNode Playground – Playground using AVAudioEngine with a playernode and effects to play an audio file. 🌟
- Miles – A Swift Playground that creates jazz improvisations in any key using AudioToolbox and AVFoundation.
Live math with playgrounds
- Guilloche Pattern Playground Book – Learn more about this pattern you see every day, but probably never knew it was really carefully designed. 🍁
- Lindenmayer Systems – A Swift playground exploring Lindemayer systems.
- Swift Natural Numbers – A playground for implementing the natural numbers and more concepts in number theory.
- Polydoxical – Interactive playground to experiment with roulettes and polygons.
- Abstract Algebra – Abstract algebra concepts implemented in Swift.
- Swift Accelerate – Using the Accelerate framework and Swift for Linear Algebra. ⏳
- Swifty Mathematics – A collection of swift playground about mathematics. ⏳
- Numerical Algorithms – Numerical argorithms playground from Ray Wenderlich. ⏳
Libraries and APIs
Library tutorials, in a playground
- AudioKit Playgrounds – 130+ Audio synthesis, processing, playback, and analysis playgrounds with AudioKit.
- AIToolbox – A set of playgrounds showing machine learning algorithms, all implemented with pieces of the AIToolbox framework code.
- Cognitive Service APIs – Get started with the Microsoft Cognitive Services APIs.
- Rx Playground – A playground with RxSwift examples.
Sets of playgrounds about various topics
- Parks And Recreation – Great collection of interesting playgrounds, for fun and for profit. 🍁🌟
- URaimo’s Playgrounds – My playgrounds, various topics. 🍁
- Public Extensions – A set of useful extensions from @PublicExtension. 🌟
- ManuelCarlos’s Playgrouds – Various playgrounds.
- Mgrebenets’s Playgrounds – Various playgrounds.c 🌟
- Cocoa With Love Playgrounds – Playground versions of select articles from Cocoa with Love. 🌟
- Sketchytech’s Playgrounds – Various Playgrounds. 🌟 ⏳
- Swift fun playgrounds – A few playgrounds to showcase Swift peculiar features. ⏳
- BradLarson’s Playgrounds – Various playgrounds. ⏳
- Dmikusa’s Playgrounds – Playgrounds that show basic Swift, JSON parsing, sending HTTP requests and basic file IO. ⏳
- Cananito’s Playgrounds – Various playgrounds. ⏳
- Uberbruns’s Playgrounds – Various playgrounds. ⏳
What doesn’t fit anywhere else, but still awesome
- Rubik’s Cube – Implementing basic model and behavior of Rubic’s Cube in Swift. 🍁
- Icon Creator – Create app icons on Swift playground.
- 2048 Playground – The 2048 game implemented with a playground.
- SwiftShell – Bash shell in a playground.
- LaunchPad Playground – A playground that simulates a real LaunchPad for making music.
- Super Maze – A programmatic maze generator and solver.
- Tic Tac Toe – Tic tac toe in a playground.
- Pixel Art Maker – A playground where you can make pixel art.
- SwiftCoin – A simplistic blockchain & cryptocurrency in a playground.
- SentimentlySwift – Sentiment analysis in Swift.
- SwiftChain – Simple Cryptocurrency in a Swift Playground.
- Game Boards – Chess, checkers, tic-tac-toe, sudoku and many others in playground. 🌟 ⏳
- StarWars Seals – Emblems from Star Wars in Swift playgrounds via CoreGraphics and UIViews. ⏳
- SwiftFiles – Save, Load and Delete files easily from within a Swift playground. ⏳
- Earth photos – A slideshow of Earth photos taken by DSCOVR/EPIC. 🌟 ⏳