{"id":795,"url":"https://github.com/codytwinton/SwiftyVIPER","last_synced_at":"2025-07-30T19:32:22.639Z","repository":{"id":48706184,"uuid":"56623102","full_name":"codytwinton/SwiftyVIPER","owner":"codytwinton","description":"Swift Interaction with VIPER Architecture","archived":false,"fork":false,"pushed_at":"2019-12-16T22:24:19.000Z","size":2472,"stargazers_count":124,"open_issues_count":6,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-24T01:42:02.072Z","etag":null,"topics":["cocoapod","ios","swift","swift-3","tvos","viper","viper-architecture","viper-template"],"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/codytwinton.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T18:52:13.000Z","updated_at":"2024-11-18T00:21:04.000Z","dependencies_parsed_at":"2022-08-26T09:42:27.447Z","dependency_job_id":null,"html_url":"https://github.com/codytwinton/SwiftyVIPER","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codytwinton%2FSwiftyVIPER","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codytwinton%2FSwiftyVIPER/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codytwinton%2FSwiftyVIPER/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codytwinton%2FSwiftyVIPER/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codytwinton","download_url":"https://codeload.github.com/codytwinton/SwiftyVIPER/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228178890,"owners_count":17881105,"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":["cocoapod","ios","swift","swift-3","tvos","viper","viper-architecture","viper-template"],"created_at":"2024-01-05T20:15:31.470Z","updated_at":"2024-12-04T19:31:58.349Z","avatar_url":"https://github.com/codytwinton.png","language":"Swift","funding_links":[],"categories":["Architecture Patterns","Swift","Code Quality","技术方向"],"sub_categories":["Other free courses","Getting Started","iOS"],"readme":"# SwiftyVIPER\n\n![Header][main-image]\n\n---\n\n[![Language][lang-image]](https://swift.org/)\n[![License][license-image]](LICENSE)\n[![Platform][platform-image]](http://cocoapods.org/pods/SwiftyVIPER)\n\n[![Build Status][build-image]](https://travis-ci.org/codytwinton/SwiftyVIPER)\n[![Docs Percentage][docs-image]](http://cocoadocs.org/docsets/SwiftyVIPER)\n[![Code Coverage][codecov-image]](https://codecov.io/gh/codytwinton/SwiftyVIPER)\n[![Code Beat][codebeat-image]](https://codebeat.co/projects/github-com-codytwinton-swiftyviper)\n\n[![Pod Version][pod-version-image]](http://cocoapods.org/pods/SwiftyVIPER)\n[![Carthage Compatible][carthage-image]](https://github.com/Carthage/Carthage)\n\nSwiftyVIPER allows easy use of VIPER architecture throughout your iOS application.\n\n## VIPER Architecture\n\nWhat is VIPER? Great question! VIPER is a [backronym](https://en.wikipedia.org/wiki/Backronym) which stands for:\n\n* View\n* Interactor\n* Presenter\n* Entity\n* Router\n\nIf all of this is totally new for you, check out my running list of [VIPER Resources](#resources)\n\n## Features\n\n* [x] VIPER Module Templates\n* [x] VIPER Unit Test Templates\n* [x] Simple Module Initialization and Presentation\n* [x] CocoaPods Support\n* [x] Carthage Support\n\n## Requirements\n\n* iOS 8.0+ | tvOS 9.0+\n* Xcode 9\n* Swift 4\n\n## Installation\n\n### CocoaPods\n\nYou can use [CocoaPods](http://cocoapods.org/) to install `SwiftyVIPER` by adding it to your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nuse_frameworks!\nplatform :ios, '8.0'\n\ndef shared_pods\n    pod 'SwiftyVIPER', '~\u003e 1.0'\nend\n\ntarget 'MyApp' do\n    shared_pods\nend\n\ntarget 'MyAppTests' do\n    shared_pods\nend\n```\n\nTo get the full benefits import `SwiftyVIPER` wherever you import UIKit\n\n``` swift\nimport UIKit\nimport SwiftyVIPER\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\nbrew update\nbrew install carthage\n```\n\nTo integrate SwiftyVIPER into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"codytwinton/SwiftyVIPER\" ~\u003e 1.0\n```\n\nRun `carthage update` to build the framework and drag the built `SwiftyVIPER.framework` into your Xcode project.\n\n#### Manually\n\nThis is discouraged, but allowed. :D\n\n1. Download and drop the ```Source``` folder in your project.\n2. Congratulations!\n\n---\n\n## Usage of SwiftyVIPER\n\n### Installing Templates\n\nIf you're looking for VIPER architecture templates to use directly within Xcode, you can find these in the `/Templates/VIPER` folder. Open your terminal and run:\n\n```bash\ncd PATH/TO/REPO\n```\n\nThen, simply run this command in your terminal:\n\n```bash\nmkdir -p ~/Library/Developer/Xcode/Templates/File\\ Templates\ncp -R Templates/VIPER ~/Library/Developer/Xcode/Templates/File\\ Templates\n```\n\n### Adding a Module\n\nOnce you've installed the VIPER Templates, you're ready to add a module. Select `File \u003e New \u003e File` or use press `⌘N` to bring up the template selector. You'll find the templates at the bottom.\n\nChoose `Module` for a normal module, `Module Storyboard` for a normal module that interacts with Storyboards, or `Module Tests` for a module unit tests template.\n\n![Choice](Assets/Template Choice.png)\n\nNext, choose the Module name. We'll go with `Custom`.\n\n![Name](Assets/Template Name.png)\n\nThis will create 5 files per module:\n\n* `CustomModule.swift`\n* `CustomViewController.swift`\n* `CustomPresenter.swift`\n* `CustomRouter.swift`\n* `CustomInteractor.swift`\n\nDon't forget to target your main app. Once you've added the main template, go ahead and add the Unit Test template. **Make sure it's the same name!** In this case, we'd stay with `Custom`.\n\n### Using SwiftyVIPER\n\nSimply add a new module using the VIPER template. Once done, simply call:\n\n```swift\nimport SwiftyVIPER\n\nCustomModule().present(from: self.viewController, style: .coverVertical, completion: nil)\n```\n\nThe module will handle the rest, including initializing and attaching all the connections necessary for the Module to show properly.\n\n## Contribute\n\nWe would love for you to contribute to **SwiftyVIPER**, check the ``LICENSE`` file for more info. Pull Requests welcome!\n\n## Resources\n\n* [mutualmobile.com](https://mutualmobile.com/posts/meet-viper-fast-agile-non-lethal-ios-architecture-framework)\n* [objc.io](https://www.objc.io/issues/13-architecture/viper/)\n* [ckl.io](https://www.ckl.io/blog/ios-project-architecture-using-viper/)\n* [stackoverflow.com](http://stackoverflow.com/questions/35132664/why-protocols-are-used-in-both-direction-in-viper-architecture-rather-than-in-on)\n* [yalantis.com](https://yalantis.com/blog/tree-of-models-as-an-alternative-app-architecture-model/)\n* [medium.com](https://medium.com/mobile-travel-technologies/architecting-mobile-apps-with-b-viper-modules-e94e277c8d68)\n* [speakerdeck.com](https://speakerdeck.com/sergigracia/clean-architecture-viper)\n* [brigade.engineering](https://brigade.engineering/brigades-experience-using-an-mvc-alternative-36ef1601a41f#.tezoetq87)\n\n## Meta\n\n* Cody Winton – [@codytwinton](https://twitter.com/codytwinton)\n* Distributed under the MIT license. See [LICENSE][license-url] for more information.\n* Inspired by [ViperMcFlurry](https://github.com/rambler-digital-solutions/ViperMcFlurry)\n* README edited with [StackEdit](https://stackedit.io/)\n\n[main-image]: Assets/SwiftyVIPER.png\n[build-image]: https://travis-ci.org/codytwinton/SwiftyVIPER.svg?branch=master\n[carthage-image]: https://img.shields.io/badge/Carthage-compatible-4BC51D.svg\n[codebeat-image]: https://codebeat.co/badges/74c04e5b-e6a2-4baa-9e09-5b08d87dcabc\n[codecov-image]: https://codecov.io/gh/codytwinton/SwiftyVIPER/branch/master/graph/badge.svg\n[docs-image]: https://img.shields.io/cocoapods/metrics/doc-percent/SwiftyVIPER.svg\n[lang-image]: https://img.shields.io/badge/swift-4.0-orange.svg\n[license-image]: https://img.shields.io/github/license/codytwinton/SwiftyVIPER.svg\n[platform-image]: https://img.shields.io/cocoapods/p/SwiftyVIPER.svg\n[pod-version-image]: https://img.shields.io/cocoapods/v/SwiftyVIPER.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodytwinton%2FSwiftyVIPER","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodytwinton%2FSwiftyVIPER","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodytwinton%2FSwiftyVIPER/lists"}