{"id":18947815,"url":"https://github.com/refactoringguru/design-patterns-swift","last_synced_at":"2025-08-19T22:32:42.331Z","repository":{"id":37550051,"uuid":"131599774","full_name":"RefactoringGuru/design-patterns-swift","owner":"RefactoringGuru","description":"Design Pattern Examples in Swift","archived":false,"fork":false,"pushed_at":"2024-04-13T11:39:34.000Z","size":2002,"stargazers_count":153,"open_issues_count":2,"forks_count":34,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-12-10T08:42:14.659Z","etag":null,"topics":["design-patterns","swift"],"latest_commit_sha":null,"homepage":"https://refactoring.guru/design-patterns/swift","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RefactoringGuru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-30T13:34:08.000Z","updated_at":"2024-11-02T06:57:14.000Z","dependencies_parsed_at":"2024-01-19T10:16:35.548Z","dependency_job_id":"8f3d5b0d-d76f-40c1-af8b-2c6907b1fdc8","html_url":"https://github.com/RefactoringGuru/design-patterns-swift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RefactoringGuru%2Fdesign-patterns-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RefactoringGuru%2Fdesign-patterns-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RefactoringGuru%2Fdesign-patterns-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RefactoringGuru%2Fdesign-patterns-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RefactoringGuru","download_url":"https://codeload.github.com/RefactoringGuru/design-patterns-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230374126,"owners_count":18216042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design-patterns","swift"],"created_at":"2024-11-08T13:11:32.761Z","updated_at":"2024-12-19T04:07:43.257Z","avatar_url":"https://github.com/RefactoringGuru.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Design Patterns in Swift\n\nThis repository is part of the [Refactoring.Guru](https://refactoring.guru/design-patterns) project.\n\nIt contains Swift examples for all classic GoF design patterns.\n\nThere are two examples for each of the patterns:\n\n- **Conceptual** examples illustrate the internal structure of a pattern, explained with detailed comments.\n\n- **RealWorld** examples illustrate how patterns can be used in real-world Swift applications.\n\n\n## Requirements\n\nFor the best experience, we recommend working with examples with [Swift 5](https://github.com/apple/swift) and [Xcode](https://developer.apple.com/xcode/) IDE.\n\n\n## Usage\n\nFor the sake of simplicity, we tried to limit the scope of these examples to the code, related to the actual patterns. That's why didn't implement full-blown Swift apps, accompanied with Run targets. Instead, our examples are packaged as unit tests, where each Unit Test target executes a specific example of a pattern.\n\nTo run an example, browse it in the project directory, select the Unit Test scheme and launch the example.\n\n![How to launch an example](/readme.gif?raw=true)\n\n\n## FAQ\n\n#### 1. What is the _Client Code_?\n\n_Client_ means _client of classes, defined as part of a pattern_, which is merely a caller of the given methods or a user of the given classes. In other words, it's the part of your application's code that uses the pattern's classes.\n\n#### 2. I don't understand the roles you're referring to in RealWorld examples.\n\nTake a look at the structural example first. There you'll find detailed descriptions of each class in a pattern, its role, and connection to other classes.\n\n\n## License\n\nThis work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.\n\n\u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-nd/4.0/\"\u003e\u003cimg alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc-nd/4.0/80x15.png\" /\u003e\u003c/a\u003e\n\n\n## Credits\n\n\"Design Patterns in Swift\" were created by [Maxim Eremenko](https://www.linkedin.com/in/maxim-eremenko/) for Refactoring.Guru.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefactoringguru%2Fdesign-patterns-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefactoringguru%2Fdesign-patterns-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefactoringguru%2Fdesign-patterns-swift/lists"}