A curated list of awesome Swift playgrounds.
Please take a quick look at the contribution guidelines first. Thanks to all contributors; you rock!
If you see a playground here that does not work anymore with the current release of Xcode or is not a good fit, please submit a pull request to improve this file or consider updating it, thank you!
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
- PlaygroundBooks
- Learning Swift
- Learning Swift: Advanced Topics
- Apple's Playgrounds
- WWDC Students Submissions
- Playgrounds about Playgrounds
- Playgrounds from Playgroundbooks
- Theoretical Computer Science
- UIKit And Graphics
- Audio
- Mathematics
- Libraries and APIs
- Playground sets
- Miscellaneous
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. π
- jscore-playground - A JavaScript REPL using JavaScriptCore. π
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.
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.
- 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. β³
- 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. β³
Playgrounds submitted by students for the WWDC scholarship
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 derived from iPad Swift Playgroundbooks
- iPad Swift Playgrounds - The sample playgroundbooks converted to playgrounds.
- 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 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. π
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. β³
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. π β³