Design-Patterns-In-Swift is a repository that translates classic software engineering design patterns (from sources like the Gang of Four) into Swift code examples, so you can see how those patterns look in a modern, strongly typed, object-/protocol-oriented language. It covers creational, structural, and behavioral patterns: singletons, factories, decorators, observers, strategy, command, mediator, and more. For each pattern, you’ll typically see one or more Swift implementations, commentary on where it makes sense in a Swift architecture, and caveats about when you might prefer pure protocol composition or using functional patterns instead. The examples aim to be readable and idiomatic—not overly abstract or contrived—so developers can adopt or adapt them directly.

Features

  • Collection of many design patterns implemented: e.g. Creational, Behavioral, Structural families (e.g. Strategy, Observer, Adapter, Singleton, etc.)
  • Provided in playground/-friendly format so users can interactively read and run examples in Xcode playgrounds
  • Chinese (中文) translated versions of playground/examples/files are included
  • Scripts to generate playgrounds from source and translations (for both English and Chinese)
  • Well-documented: README with table of contents of patterns, explanations of pattern intent, usage, etc.
  • Licensed under GPL-3.0, which means open source but with copyleft requirements (if modifications are shared etc.)

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

GNU General Public License version 3.0 (GPLv3)

Follow Design Patterns in Swift

Design Patterns in Swift Web Site

You Might Also Like
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Design Patterns in Swift!

Additional Project Details

Operating Systems

Apple iPhone, Mac

Programming Language

Swift

Related Categories

Swift Libraries

Registered

2025-09-22