Cobra

Cobra is a lightweight application routing framework written in Swift
Alternatives To Cobra
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Literoute90
3 years ago1April 15, 20207mitSwift
LiteRoute is easy transition for your app. Written on Swift 4
Vmc217
6 years agomitSwift
Evolution of MVC on iOS with examples. MVC, VIPER, MVVM, MVP
Cobra10
25 years ago5October 22, 2018apache-2.0Swift
Cobra is a lightweight application routing framework written in Swift
Wireframes6
5 years ago3mitSwift
Routing in an iOS app abstracted
Vipers Wireframe Protocol3
7 years agomitSwift
The wireframe is the powerful thing that wires the view controllers in your app together. It takes an NSURL and some parameters, talks to the components that create your view controllers (the ControllerProvider) which create the view controller connected to this URL, and gives it to those components which are responsible for presenting your controller (the ControllerRoutingPresenter).
Todo3
8 months agoSwift
This Todo app is a full reference implementation for VIPER. It demonstrates many of the tasks you would do on a daily basis.
Alternatives To Cobra
Select To Compare


Alternative Project Comparisons
Readme

Cobra

Build Status

Cobra is a lightweight application routing framework written in Swift that provides modular abstractions to your code base. Cobra is built on top of Swinject, a lightweight dependency injection framework.

Features

  • [X] Type safe application routing via features
  • [X] Multiple flavor (e.g. environments) support for different components
  • [X] Proxy powered routing for easy A/B testing of features
  • [X] Foundation for modular code architecture

Cobra works best when used with Gorgon, an application event distribution framework written in Swift, and Moccasin, Xcode templates that provides VIPER-based scaffolding.

See Boa, a sample app written in Swift, for details.

Requirements

  • iOS 8+
  • Swift 3
  • Xcode 8.0+

Installation

Cobra is available through CocoaPods or Carthage.

CocoaPods

To install Cobra with CocoaPods, add the following lines to your Podfile.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Cobra', '~> 3.0'

Then run pod install command. For details of the installation and usage of CocoaPods, visit its official website.

Carthage

To install Cobra with Carthage, add the following line to your Cartfile.

github "locationlabs/Cobra" ~> 3.0

Then run carthage update. For details of the installation and usage of Carthage, visit its project page.

Documentation

Cobra is a VIPER-based application routing framework for building modular iOS applications. Using Cobra, an application is broken up into VIPER modules, each module consisting of the following types: View, Interactor, Presenter, Router, Data Manager, Styler, Assembler, Storyboard and Feature. Each of these types own a single responsibility, i.e. the View is responsible for view logic, the Interactor is responsible for business logic, etc. Dividing application logic into distinct layers of responsibility this way enables developers to isolate dependencies, test interactions, and generally write clear and consistent code.

Creating a Module

Cobra works best when used with Moccasin, which leverages Xcode templates to generate VIPER-based scaffolding.

Bootstrapping

Component frameworks and VIPER modules are bootstrapped like so:

    // Create a Cobra configuration for assembling the components and properties for the application
    let config = Config(components: [
        Component<DaemonAssembly>(),
        Component<ServiceAssembly>()
    ], properties: [
        JsonProperty(name: "properties")
    ])
    
    // Provide the configuration to the Cobra application
    try! App.sharedInstance.config(config)

    // Register Feature to Module proxies for the Cobra application routes
    App.sharedInstance.registerProxies([
        Proxy<AddCityFeatureType>(modules: Module<AddCityAssembly>()),
        Proxy<WeatherFeatureType>(modules: Module<WeatherAssembly>()),
        Proxy<WeatherDetailFeatureType>(modules: Module<WeatherDetailAssembly>())
    ])
    
    // Route to our first feature in our application window
    try! App.sharedInstance.feature(WeatherFeatureType.self).showInWindow(window!)
    return true
}
Popular Routing Projects
Popular Viper Projects
Popular Networking Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Swift
Routing
Ios Swift
Viper