{"id":21069239,"url":"https://github.com/0xyanis/clean-swiftui","last_synced_at":"2025-04-12T20:41:28.459Z","repository":{"id":213132557,"uuid":"733112482","full_name":"0xYanis/Clean-SwiftUI","owner":"0xYanis","description":"A simple example of a CleanSwift architecture with SwiftUI","archived":false,"fork":false,"pushed_at":"2024-01-11T18:51:31.000Z","size":91,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T14:55:50.316Z","etag":null,"topics":["clean-architecture","clean-swift","coordinator","dependency-injection","example","mvvm","mvvm-coordinator","sample","swift","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xYanis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-12-18T15:35:52.000Z","updated_at":"2024-12-14T13:25:24.000Z","dependencies_parsed_at":"2024-11-19T18:41:36.520Z","dependency_job_id":"df9c48cc-2b71-478a-9001-fec905f51eef","html_url":"https://github.com/0xYanis/Clean-SwiftUI","commit_stats":null,"previous_names":["0xyanis/clean-swiftui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xYanis%2FClean-SwiftUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xYanis%2FClean-SwiftUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xYanis%2FClean-SwiftUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xYanis%2FClean-SwiftUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xYanis","download_url":"https://codeload.github.com/0xYanis/Clean-SwiftUI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631669,"owners_count":21136554,"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":["clean-architecture","clean-swift","coordinator","dependency-injection","example","mvvm","mvvm-coordinator","sample","swift","swiftui"],"created_at":"2024-11-19T18:33:37.326Z","updated_at":"2025-04-12T20:41:28.439Z","avatar_url":"https://github.com/0xYanis.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clean SwiftUI Architecture\n\nThis repository contains a sample application using CleanSwift Architecture consisting of two screens - a user list and their todos.\n\n## Installation\n\nTo run this application on your device, follow these steps:\n\n1. Ensure Xcode is installed on your computer.\n2. Clone this repository to your computer.\n\n```\ngit clone https://github.com/0xYanis/Clean-SwiftUI\n```\n   \n4. Open the project file in Xcode.\n5. Build and run it on the simulator or device of your choice.\n\n## Usage\n\nThis repository demonstrates an example of using Clean Swift Architecture for app development. You can study the code and project structure to better understand the principles of Clean Swift.\nAt the same time, this repository shows how easy it is to create unnecessary entities in a simple application ))\n\n## Project Structure\n\n- **User List Screen**: Displays a list of users.\n- **User Todos Screen**: Displays the todos for the selected user.\n\n\u003chtml\u003e\n \u003cbody\u003e\n  \u003cp\u003e\n    \u003cimg src=\"Resources/diagram.png\"\u003e\n  \u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e\n\n## Thinking out loud\n\nOf course, no one forces you to build an application using so many components, and you can limit yourself to something like this:\n\n```Swift\nstruct UserListView: View {\n    @State var users = [User]()\n    \n    var body: some View {\n        NavigationStack {\n            List(users) { user in\n                Text(user.name)\n            }\n            .navigationTitle(\"Users\")\n        }\n        .onAppear {\n            Task {\n                let url = URL(string: \"https://jsonplaceholder.typicode.com/users\")!\n                let (data, _) = try! await URLSession.shared.data(from: url)\n                let users = try! JSONDecoder().decode([User].self, from: data)\n                await MainActor.run(body: {\n                    self.users = users\n                })\n            }\n        }\n    }\n}\n```\nHowever, architecture is the foundation of the application.\n\n## Borrowing\n\nThe following borrowings were used in this application:\n- **JSONPlaceholder** [Example data](https://jsonplaceholder.typicode.com)\n- **Coordinator-SwiftUI** [Coordinator by Alex Nagy](https://www.youtube.com/watch?v=aaLRST7tHFQ)\n\n## Contribution\n\nIf you have any suggestions for improving this sample, please create an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the [MIT License](https://github.com/0xYanis/Clean-SwiftUI/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xyanis%2Fclean-swiftui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xyanis%2Fclean-swiftui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xyanis%2Fclean-swiftui/lists"}